diff options
Diffstat (limited to 'contrib/ssh-copy-id')
-rw-r--r-- | contrib/ssh-copy-id | 10 |
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 |
39 | fi | 39 | fi |
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 |
42 | host=`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 | ||
43 | cat <<EOF | 46 | cat <<EOF |
44 | Now try logging into the machine, with "ssh '${1%:}'", and check in: | 47 | Now try logging into the machine, with "ssh '$host'", and check in: |
45 | 48 | ||
46 | .ssh/authorized_keys | 49 | ~/.ssh/authorized_keys |
47 | 50 | ||
48 | to make sure we haven't added extra keys that you weren't expecting. | 51 | to make sure we haven't added extra keys that you weren't expecting. |
49 | 52 | ||
50 | EOF | 53 | EOF |
54 | |||