I often use Ubuntu's GNOME Terminal to connect to an external server using ssh. When rebooting the server the Terminal shows this message:

# reboot

Broadcast message from root (pts/0) (Wed Sep 29 13:52:26 2010):

The system is going down for reboot NOW!
# 

And a seconds later the Terminal no longer responds to keystrokes, CTRL-c, CTRL-d, etc... The only escape seems to be closing the Terminal window from the GUI.

Does anyone know of a more elegant way to break out of ssh after a remote server reboot?

link|improve this question

53% accept rate
feedback

2 Answers

up vote 3 down vote accepted

Type

~. (tilde followed by dot)

and look for 'escape characters' in the man page of ssh.

link|improve this answer
Works like charm. Thank you! – StackedCrooked Sep 29 '10 at 14:25
feedback

Try using shutdown instead. It allows you to specify a time before the shutdown occurs. Gives you a chance to log out of the session:

sudo /sbin/shutdown -r 60 "System is rebooting in 60 seconds!"
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.