aboutsummaryrefslogtreecommitdiff
path: root/ssh-authorized-send
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-authorized-send')
-rwxr-xr-xssh-authorized-send11
1 files changed, 11 insertions, 0 deletions
diff --git a/ssh-authorized-send b/ssh-authorized-send
new file mode 100755
index 0000000..c743812
--- /dev/null
+++ b/ssh-authorized-send
@@ -0,0 +1,11 @@
+#!/bin/bash
+#
+# Send both public and private keys to a server.
+#
+
+KEY="$1"
+SERVER="$2"
+DESTKEY="~/.ssh/`basename $KEY`"
+
+# Put on authorized_keys
+cat $KEY | ssh $SERVER "mkdir -p ~/.ssh && chmod 700 ~/.ssh && touch ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys && cat >> ~/.ssh/authorized_keys"