(Copied from Debian bug #313371) When using nc or socat to bounce connections to an ssh server via an intermediary, "Killed by signal 1." is printed when I log out. Signal 1 is SIGHUP. This does not happen with OpenSSH 3.9 or earlier. Example commands: ssh -o 'ProxyCommand ssh localhost socat - TCP4:%h:%p' localhost ssh -o 'ProxyCommand ssh localhost nc %h %p' localhost The first 'localhost' is normally the intermediary host. Reproduced on: Linux 2.6.14, FreeBSD 6.0, Solaris 8
Well, the sighup is from this line in ssh.c: if (proxy_command_pid > 1) kill(proxy_command_pid, SIGHUP); but without that, some proxycommands will hang around indefinitely. The easy way to prevent it is to use "ssh -q foo bar" as the proxycommand.
The current behaviour won't change, please use the workaround provided.
Change all RESOLVED bug to CLOSED with the exception of the ones fixed post-4.4.
Created attachment 1803 [details] debug() and cleanup_exit() on signal rather than fatal()
Closely related to this, it was pointed out to me in http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=313371#10 that ssh really shouldn't print a message when it's killed by SIGTERM or SIGINT, since those typically correspond to explicit user actions which the user doesn't need to be told about again. Does this make sense to you as well? For the sake of completeness, I've attached the patch that we're currently using in Debian to reduce these errors to debug messages. At the time I didn't realise that -q would suppress output from fatal(), though, so I may drop this patch once I've looked into whether any dependent software in Debian still needs it. It is perhaps worth noting that this patch also produces a more accurate exit code ...