Bug 2437 - ssh with ControlMaster and ControlPath hangs on 2nd session in same terminal
Summary: ssh with ControlMaster and ControlPath hangs on 2nd session in same terminal
Status: NEW
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 6.7p1
Hardware: amd64 Linux
: P5 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-07-31 05:13 AEST by Uwe Kleine-König
Modified: 2015-07-31 05:13 AEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Uwe Kleine-König 2015-07-31 05:13:50 AEST
with two terminals a hang can be reproduces as follows:

 - In terminal 1 do:

 	ssh -o "ControlMaster auto" -o "ControlPath ~/.ssh/sshctrl-%l-%h-%p-%r" localhost

 - In terminal 2 do the same:

 	ssh -o "ControlMaster auto" -o "ControlPath ~/.ssh/sshctrl-%l-%h-%p-%r" localhost

 - Then back in terminal 1 again:

 	logout

   This doesn't terminate the ssh-command to keep the control socket
   open. Then pressing Ctrl-Z and run bg to send the ssh into the
   background.

 - The "remote" shell in the 2nd terminal is still working.

 - Now repeat the ssh command in the first terminal:

	ssh -o "ControlMaster auto" -o "ControlPath ~/.ssh/sshctrl-%l-%h-%p-%r" localhost

Both sessions don't react any more. The only way I found to resolve up
to now is to kill all related ssh sessions with kill(1).

Note that just exiting the first shell after sending the ssh process
that created the control socket in the background works fine. Also
adding new sessions in a third terminal works then.

Note this is already reported to the Debian bug tracker under https://bugs.debian.org/794063 and I was asked to forward it here.