Skip to content

Commit

Permalink
fixup! if -s & -p specified, mention 'sftp -P' on
Browse files Browse the repository at this point in the history
success

SSH-Copy-ID-Upstream: 32686e7c65b4fa2846e474d3315102dfa0f043b0
  • Loading branch information
phil-hands authored and daztucker committed May 25, 2023
1 parent 204e0bf commit 2709809
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions contrib/ssh-copy-id
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ do
use_id_file "${OPTARG:-$DEFAULT_PUB_ID_FILE}"
;;
o|F)
SSH_OPTS="${SSH_OPTS:+$SSH_OPTS }-$OPT '$(quote "${OPTARG}")'"
OPTS_oF="${OPTS_oF:+$OPTS_oF }-$OPT '$(quote "${OPTARG}")'"
;;
f)
FORCED=1
Expand Down Expand Up @@ -166,7 +166,8 @@ fi

USER_HOST="$*"
# tack the hostname onto SSH_OPTS
SSH_OPTS="${SSH_OPTS:+$SSH_OPTS }${SSH_PORT:+-p $SSH_PORT }'$(quote "$USER_HOST")'"
OPTS_USER_HOST="${OPTS_oF:+$OPTS_oF }'$(quote "$USER_HOST")'"
SSH_OPTS="${SSH_PORT:+-p $SSH_PORT }$OPTS_USER_HOST"
# and populate "$@" for later use (only way to get proper quoting of options)
eval set -- "$SSH_OPTS"

Expand Down Expand Up @@ -378,7 +379,7 @@ else
Number of key(s) added: $ADDED
Now try logging into the machine, with: "${SFTP:-ssh}${SSH_PORT:+ -${PORT_OPT:-p} '$SSH_PORT'} ${SSH_OPTS}"
Now try logging into the machine, with: "${SFTP:-ssh}${SSH_PORT:+ -${PORT_OPT:-p} $SSH_PORT} ${OPTS_USER_HOST}"
and check to make sure that only the key(s) you wanted were added.
EOF
Expand Down

0 comments on commit 2709809

Please sign in to comment.