Bug 2383

Summary: ssh-copy-id hangs when already connected with connection sharing
Product: Portable OpenSSH Reporter: Paul Tobias <tobias.pal>
Component: ssh-copy-idAssignee: Assigned to nobody <unassigned-bugs>
Status: CLOSED DUPLICATE    
Severity: minor    
Priority: P5    
Version: 6.8p1   
Hardware: All   
OS: All   
Attachments:
Description Flags
ssh-copy-id-connection-sharing-hang.patch none

Description Paul Tobias 2015-04-16 00:58:23 AEST
Created attachment 2587 [details]
ssh-copy-id-connection-sharing-hang.patch

If I successfully ssh into somewhere and then try to use ssh-copy-id, it just hangs.

I have this in my .ssh/config:
ControlMaster  auto
ControlPath    /dev/shm/ssh_control_%h_%p_%r
ControlPersist 3600

It's because of this line in ssh-copy-id:
REMOTE_VERSION=$(ssh -v -o PreferredAuthentications=',' "$@" 2>&1 |
                 sed -ne 's/.*remote software version //p')

Because of the connection sharing, this doesn't fail, but opens a shell on the other side and waits for input indefinitely.

A simple fix is to add -o ControlPath=none.
Comment 1 Paul Tobias 2015-04-16 02:18:39 AEST
Oh, this was already reported as bug 2195. I went through the process at http://www.openssh.com/report.html, but I didn't see that bug.

*** This bug has been marked as a duplicate of bug 2195 ***
Comment 2 Damien Miller 2015-08-11 23:04:03 AEST
Set all RESOLVED bugs to CLOSED with release of OpenSSH 7.1