aboutsummaryrefslogtreecommitdiffstats
path: root/ssh-keys-import
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-keys-import')
-rw-r--r--ssh-keys-import10
1 files changed, 10 insertions, 0 deletions
diff --git a/ssh-keys-import b/ssh-keys-import
new file mode 100644
index 0000000..56ba6a4
--- /dev/null
+++ b/ssh-keys-import
@@ -0,0 +1,10 @@
+# RouterOS script: ssh-keys-import
+# Copyright (c) 2013-2018 Christian Hesse <mail@eworm.de>
+#
+# import ssh keys from file
+
+# Split files with several keys from a shell...
+# while read type key name; do echo $type $key $name > $name.pub; done < keys.pub
+# ... then transfer with scp/sftp.
+
+:foreach key in=[ / file find where type="ssh key" ] do={ / user ssh-key import user=admin public-key-file=[ / file get $key name ]; }