OpenSSH client hangs on logout when forwarding X connections

admiles picture admiles · Nov 29, 2012 · Viewed 10.4k times · Source

I setup Ubuntu Linux to run an OpenSSH server. My DSL router is port forwarding the SSH connection. When I use

ssh -X myhost

and then open some GUI program, then close the GUI application and exit, then the SSH logout hangs. <Ctrl>-c seems to work but its annoying to have to press it everytime. The logout will not hang if I don't open a GUI.

Anyone have ideas how to fix this problem?

Answer

Lars Kotthoff picture Lars Kotthoff · Nov 29, 2012

This is because the process you start opens a stream (stdout/stderr) and doesn't close it. Have a look here for a more in-depth explanation and possible solutions.