ssh-copy-id-with-i-arg.txt

Type: text/x-diff, Size: 1462 bytes, SHA256: aa1a3fb2bdfd6e4416328367a517575887d58553e814df32afb8020f3e055fac.
UTC timestamps: upload: 2015-01-06 22:21:33, download: 2024-05-06 03:32:46, max lifetime: forever.

--- ssh-copy-id.orig 2015-01-06 22:31:42.970475967 +0100

+++ ssh-copy-id 2015-01-06 23:16:56.778577172 +0100

@@ -206,29 +206,7 @@

trap "rm -f $L_TMP_ID_FILE ${L_TMP_ID_FILE}.pub" EXIT TERM INT QUIT

printf '%s: INFO: attempting to log in with the new key(s), to filter out any that are already installed\n' "$0" >&2

NEW_IDS=$(

- eval $GET_ID | {

- while read ID ; do

- printf '%s\n' "$ID" > $L_TMP_ID_FILE

-

- # the next line assumes $PRIV_ID_FILE only set if using a single id file - this

- # assumption will break if we implement the possibility of multiple -i options.

- # The point being that if file based, ssh needs the private key, which it cannot

- # find if only given the contents of the .pub file in an unrelated tmpfile

- ssh -i "${PRIV_ID_FILE:-$L_TMP_ID_FILE}" \

- -o PreferredAuthentications=publickey \

- -o IdentitiesOnly=yes "$@" exit 2>$L_TMP_ID_FILE.stderr </dev/null

- if [ "$?" = "$L_SUCCESS" ] ; then

- : > $L_TMP_ID_FILE

- else

- grep 'Permission denied' $L_TMP_ID_FILE.stderr >/dev/null || {

- sed -e 's/^/ERROR: /' <$L_TMP_ID_FILE.stderr >$L_TMP_ID_FILE

- cat >/dev/null #consume the other keys, causing loop to end

- }

- fi

-

- cat $L_TMP_ID_FILE

- done

- }

+ eval $GET_ID

)

rm -f $L_TMP_ID_FILE* && trap - EXIT TERM INT QUIT