ssh-copy-id

dweimer dweimer at dweimer.net
Fri Feb 28 19:34:52 UTC 2014


Has anyone had any luck getting the ssh-copy-id script that is included 
with FreeBSD 10 working?

When using it with the -i option to pass the identity key, I get a 
printf error message.

ssh-copy-id -i /home/dweimer/.ssh/id_rsa dweimer at webmail.dweimer.net
Password for dweimer at webmail.dweimer.local:
printf: Illegal option --


Both of these systems are FreeBSD 10 systems, I took a look at 
/usr/src/usr.bin/ssh-copy-id/ssh-copy-id.sh, and am wondering if the -- 
in the mkdir line below is the culprit, or if maybe something else isn't 
escaped properly.

sendkey() {
         local h="$1"
         local k="$2"
         printf "%s\n" "$k" | ssh $port -S none $options "$user$h" 
/bin/sh -c \'' \
                 set -e; \
                 umask 077; \
                 keyfile=$HOME/.ssh/authorized_keys ; \
                 mkdir -p -- "$HOME/.ssh/" ; \
                 while read alg key comment ; do \
                         [ -n "$key" ] || continue; \
                         if ! grep -sqwF "$key" "$keyfile"; then \
                                 printf "$alg $key $comment\n" >> 
"$keyfile" ; \
                         fi ; \
                 done \
         '\'
}

-- 
Thanks,
    Dean E. Weimer
    http://www.dweimer.net/


More information about the freebsd-stable mailing list