Bug 2195 - ssh-copy-id hangs when using shared connection
Summary: ssh-copy-id hangs when using shared connection
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh-copy-id (show other bugs)
Version: 6.7p1
Hardware: Other Linux
: P5 enhancement
Assignee: Philip Hands
URL:
Keywords:
: 2383 (view as bug list)
Depends on:
Blocks: V_7_2
  Show dependency treegraph
 
Reported: 2014-01-08 13:47 AEDT by catern
Modified: 2016-08-02 10:41 AEST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description catern 2014-01-08 13:47:41 AEDT
If ControlPath is specified and ControlMaster is set to auto, ssh-copy-id will hang permanently when trying to connect to a host for which there is already an open connection.
Comment 1 versalismeisteralis 2014-12-02 16:11:18 AEDT
Please see
https://bugs.launchpad.net/ubuntu/+source/openssh/+bug/1342412

There is a fix (a new version of ssh-copy-id) in Ubuntu for this.

https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/saucy/openssh/saucy/view/head:/contrib/ssh-copy-id

Is it possible to fix this annoying (entering your password twice) behavior?
Comment 2 versalismeisteralis 2014-12-02 16:15:39 AEDT
If it is not possible to use the Ubuntu version, a quick fix would be 


if [ -d ~/.ssh/sockets ] ; then
	REMOTE_VERSION="generic"
else
	REMOTE_VERSION=$(ssh -v -o PreferredAuthentications=',' "$@" 2>&1 |
                 sed -ne 's/.*remote software version //p')
fi
Comment 3 Paul Tobias 2015-04-16 02:18:39 AEST
*** Bug 2383 has been marked as a duplicate of this bug. ***
Comment 4 Philip Hands 2015-11-29 03:43:56 AEDT
This bug applied to the old version of the script, but the new version had the same fault, which has now been fixed in my git repo:

  http://git.hands.com/?p=ssh-copy-id.git;a=commitdiff;h=e129c91dc474d73671304403fafda785df440105;hp=35f05e39cda8670b3f6797330a3e521fda509a4c

Perhaps you could have a look at the latest version here:

  http://git.hands.com/sh-copy-id

and check that it works for you.

Cheers, Phil.
Comment 5 Damien Miller 2016-08-02 10:41:16 AEST
Close all resolved bugs after 7.3p1 release