aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-03-14 09:02:06 -0300
committerSilvio Rhatto <rhatto@riseup.net>2017-03-14 09:02:06 -0300
commit78056db240dadd1b8656d1cc541a1a4a2e45e518 (patch)
tree04b1f3124e4f2b353e39db848f58ab5d96d5052e
parent7a971e64a274598c473e0b70d3e709c63a4b6d9c (diff)
downloadutils-ssh-78056db240dadd1b8656d1cc541a1a4a2e45e518.tar.gz
utils-ssh-78056db240dadd1b8656d1cc541a1a4a2e45e518.tar.bz2
Adds ssh-authorized-send and updates ssh-privsend
-rwxr-xr-xssh-authorized-send11
-rwxr-xr-xssh-privsend2
2 files changed, 12 insertions, 1 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"
diff --git a/ssh-privsend b/ssh-privsend
index a7788a2..8767f57 100755
--- a/ssh-privsend
+++ b/ssh-privsend
@@ -8,7 +8,7 @@ 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"
+#ssh-authorized-send $KEY.pub
# Public key
cat $KEY.pub | ssh $SERVER "mkdir -p ~/.ssh && chmod 700 ~/.ssh && touch $DESTKEY.pub && chmod 600 $DESTKEY.pub && cat >> $DESTKEY.pub"