Bug 194301

Summary: ssh-copy-id doesn't work on 10.1-RC2
Product: Base System Reporter: Piotr Kubaj <pkubaj>
Component: binAssignee: Eitan Adler <eadler>
Status: Closed FIXED    
Severity: Affects Many People CC: miguelmclara, moiseev, ohauer, robert, rosskilgariff
Priority: --- Flags: eadler: mfc-stable10?
eadler: mfc-stable9?
eadler: mfc-stable8-
Version: 10.1-STABLE   
Hardware: Any   
OS: Any   

Description Piotr Kubaj freebsd_committer 2014-10-11 14:32:06 UTC
I use releng/10.1 at r272885. When I try to copy my private key with
'ssh-copy-id ~/.ssh/id_rsa.pub root@IP', I get:
Unmatched '.
Unmatched '.
Using ssh-copy-id in /usr/src/crypto/openssh/contrib/ seems to work.
Comment 1 Piotr Kubaj freebsd_committer 2014-10-12 09:12:08 UTC
I obviously meant public key, not the private one :)
Comment 2 Robert Sevat 2014-11-16 06:01:06 UTC
This also does not work in 10.1-RELEASE. Both me and other user on irc just noticed it is broken.
Comment 3 Olli Hauer freebsd_committer 2015-01-05 17:56:52 UTC
- Assign to eadler
Comment 4 Ross Kilgariff 2015-01-21 12:13:48 UTC
I added a (previously missing?) line continuation - seems to work correctly:

--- usr.bin/ssh-copy-id/ssh-copy-id.sh.orig
+++ usr.bin/ssh-copy-id/ssh-copy-id.sh
@@ -48,7 +48,7 @@
        done ; \
        if [ -x /sbin/restorecon ]; then \
            /sbin/restorecon -F "$HOME/.ssh/" "$keyfile" >/dev/null 2>&1 || true ; \
-       fi
+       fi \
Comment 5 miguelmclara 2015-02-14 22:59:41 UTC
I've never used ssh-copy-id on freebsd before, but I was just doing some tests with ansible and this was suggested at some point and I noticed the reported issue still exists (on 10.1 and 11-CURRENT)

the fix seems to be the missing "/" as suggested by Ross Kilgariff.
Comment 6 Marcus von Appen freebsd_committer freebsd_triage 2015-02-18 11:54:21 UTC
Updated 10.1-BETA and 10.1-RC versioned bugs to 10.1-STABLE.
Comment 7 miguelmclara 2015-05-16 02:06:32 UTC
FYI this bug is still present, and the proposed patch works.


FreeBSD r2d2 11.0-CURRENT FreeBSD 11.0-CURRENT #11 r282430+eacabb4(master)
Comment 8 commit-hook freebsd_committer 2015-05-16 06:16:33 UTC
A commit references this bug:

Author: eadler
Date: Sat May 16 06:15:49 UTC 2015
New revision: 283001
URL: https://svnweb.freebsd.org/changeset/base/283001

  ssh-copy-id: Add missing line continuation

  PR:		194301
  Reported by:	pkubaj@riseup.net
  Patch by:	Ross Kilgariff <rosskilgariff@gmail.com>

Comment 9 Eitan Adler freebsd_committer freebsd_triage 2015-05-16 06:16:54 UTC
I just committed the fix.  Sorry about the delay.
Comment 10 commit-hook freebsd_committer 2015-06-10 01:18:13 UTC
A commit references this bug:

Author: eadler
Date: Wed Jun 10 01:17:15 UTC 2015
New revision: 284197
URL: https://svnweb.freebsd.org/changeset/base/284197

  MFC r283001:
  	ssh-copy-id: Add missing line continuation

  PR:		194301
  Requested by:	tuexen

_U  stable/10/
Comment 11 Glen Barber freebsd_committer 2015-07-07 15:38:34 UTC
MFC complete.