From owner-freebsd-stable@FreeBSD.ORG Fri Feb 28 19:34:52 2014 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 5CAC3C5D for ; Fri, 28 Feb 2014 19:34:52 +0000 (UTC) Received: from webmail.dweimer.net (24-240-198-187.static.stls.mo.charter.com [24.240.198.187]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 2986F1E3A for ; Fri, 28 Feb 2014 19:34:51 +0000 (UTC) Received: from www.dweimer.net (webmail [192.168.5.2]) by webmail.dweimer.net (8.14.7/8.14.7) with ESMTP id s1SJYoJZ005495 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Fri, 28 Feb 2014 13:34:51 -0600 (CST) (envelope-from dweimer@dweimer.net) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 28 Feb 2014 13:34:50 -0600 From: dweimer To: FreeBSD Stable Subject: ssh-copy-id Organization: dweimer.net Mail-Reply-To: dweimer@dweimer.net Message-ID: <2cba8fd9cc51dedc1bd5e127046f4ab7@dweimer.net> X-Sender: dweimer@dweimer.net User-Agent: Roundcube Webmail/1.0-rc X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list Reply-To: dweimer@dweimer.net List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Feb 2014 19:34:52 -0000 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/