summaryrefslogtreecommitdiff
path: root/contrib/ssh-copy-id
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/ssh-copy-id')
-rw-r--r--contrib/ssh-copy-id10
1 files changed, 7 insertions, 3 deletions
diff --git a/contrib/ssh-copy-id b/contrib/ssh-copy-id
index 2f757de4b..368645cb4 100644
--- a/contrib/ssh-copy-id
+++ b/contrib/ssh-copy-id
@@ -38,13 +38,17 @@ if [ "$#" -lt 1 ] || [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
38 exit 1 38 exit 1
39fi 39fi
40 40
41{ eval "$GET_ID" ; } | ssh ${1%:} "umask 077; test -d .ssh || mkdir .ssh ; cat >> .ssh/authorized_keys" || exit 1 41# strip any trailing colon
42host=`echo $1 | sed 's/:$//'`
43
44{ eval "$GET_ID" ; } | ssh $host "umask 077; test -d ~/.ssh || mkdir ~/.ssh ; cat >> ~/.ssh/authorized_keys" || exit 1
42 45
43cat <<EOF 46cat <<EOF
44Now try logging into the machine, with "ssh '${1%:}'", and check in: 47Now try logging into the machine, with "ssh '$host'", and check in:
45 48
46 .ssh/authorized_keys 49 ~/.ssh/authorized_keys
47 50
48to make sure we haven't added extra keys that you weren't expecting. 51to make sure we haven't added extra keys that you weren't expecting.
49 52
50EOF 53EOF
54