Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 28 Feb 2014 13:34:50 -0600
From:      dweimer <dweimer@dweimer.net>
To:        FreeBSD Stable <freebsd-stable@freebsd.org>
Subject:   ssh-copy-id
Message-ID:  <2cba8fd9cc51dedc1bd5e127046f4ab7@dweimer.net>

next in thread | raw e-mail | index | archive | help
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@webmail.dweimer.net
Password for dweimer@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/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2cba8fd9cc51dedc1bd5e127046f4ab7>