[GLLUG] ssh hangs on remote shutdown

C. Ulrich dincht at securenym.net
Mon Jan 5 11:44:27 EST 2004


On Mon, 2004-01-05 at 10:25, Scott Harrison wrote:
> Hi:
> 
> An ongoing phenomenon I have noticed is:
> 
> [invokingshell %] ssh user at remotemachine
> [remotemachine %] shutdown -r +2 &
> [remotemachine %] exit (or Ctrl-D)
> 
> The ssh session hangs on me, not returning me to the invoking shell.
> 
> I have noticed this throughout the years and am right now
> witnessing this with Mandrake 9.2.
> 
> Help stop hung terminals!  Anybody else know what's going
> on and/or has investigated this?
> 
> Regards,
> Scott

I don't know the specifics behind it, but ssh will hang whenever you run
a process on the remote machine that hasn't finished by the time you're
ready to log out. In most cases, just closing the terminal will have no
ill effects. With an xterm, this is easy if inconvenient. If you're
logging in from a virtual terminal on the local console, you'll probably
just have to wait until the remote machine shuts down and closes the
network connection before your terminal is free again. I don't know
whether or not there's any kind of timeout in the case that you aren't
shutting the machine down and the process will never end without some
sort of input.

There's a little bit more info in the OpenSSH FAQ:

http://www.openssh.org/faq.html#3.10

Hope this helps!

Charles Ulrich
-- 
http://bityard.net



More information about the linux-user mailing list