diff options
Diffstat (limited to 'contrib/ssh-copy-id')
-rw-r--r-- | contrib/ssh-copy-id | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/ssh-copy-id b/contrib/ssh-copy-id index 1555b5d37..2c480e359 100644 --- a/contrib/ssh-copy-id +++ b/contrib/ssh-copy-id | |||
@@ -1,17 +1,17 @@ | |||
1 | #!/bin/sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | # Shell script to install your identity.pub on a remote machine | 3 | # Shell script to install your public key on a remote machine |
4 | # Takes the remote machine name as an argument. | 4 | # Takes the remote machine name as an argument. |
5 | # Obviously, the remote machine must accept password authentication, | 5 | # Obviously, the remote machine must accept password authentication, |
6 | # or one of the other keys in your ssh-agent, for this to work. | 6 | # or one of the other keys in your ssh-agent, for this to work. |
7 | 7 | ||
8 | ID_FILE="${HOME}/.ssh/identity.pub" | 8 | ID_FILE="${HOME}/.ssh/id_rsa.pub" |
9 | 9 | ||
10 | if [ "-i" = "$1" ]; then | 10 | if [ "-i" = "$1" ]; then |
11 | shift | 11 | shift |
12 | # check if we have 2 parameters left, if so the first is the new ID file | 12 | # check if we have 2 parameters left, if so the first is the new ID file |
13 | if [ -n "$2" ]; then | 13 | if [ -n "$2" ]; then |
14 | if expr "$1" : ".*\.pub" ; then | 14 | if expr "$1" : ".*\.pub" >/dev/null; then |
15 | ID_FILE="$1" | 15 | ID_FILE="$1" |
16 | else | 16 | else |
17 | ID_FILE="$1.pub" | 17 | ID_FILE="$1.pub" |
@@ -19,7 +19,7 @@ if [ "-i" = "$1" ]; then | |||
19 | shift # and this should leave $1 as the target name | 19 | shift # and this should leave $1 as the target name |
20 | fi | 20 | fi |
21 | else | 21 | else |
22 | if [ x$SSH_AUTH_SOCK != x ] ; then | 22 | if [ x$SSH_AUTH_SOCK != x ] && ssh-add -L >/dev/null 2>&1; then |
23 | GET_ID="$GET_ID ssh-add -L" | 23 | GET_ID="$GET_ID ssh-add -L" |
24 | fi | 24 | fi |
25 | fi | 25 | fi |