4 ms·
> so your ssh connection would then hang .. ProTip, the ssh manpage has a great section on "Escape Characters". By default you can terminate an open ssh-sessi
by stevekemp 7y ago
> so your ssh connection would then hang ..
ProTip, the ssh manpage has a great section on "Escape Characters".
By default you can terminate an open ssh-session by typing:
"Enter", "~", then ".".
There are other options, such as adding/listing port-forwarding at run-time and backgrounding your open ssh connection too.
- gwd 7y agoManually breaking the connection is tolerable-but-annoying for interactive sessions. The place where this caused real problems for me is in my testing setup, where I would have scripts do something like: ssh <host> "shutdown -h now ; exit" [wait for the machine to stop responding to pings] [wait for the machine to start responding to pings] [Do the next thing] ...and if it didn't shut down within a certain amount of time, or come back up within a certain amount of time, treat it as a failure. With ssh hanging: * If the shutdown/start again succeeds, then the "wait for it to stop responding to pings" happens after it's rebooted. * If the boot doesn't succeed, the whole system waits for ssh's timeout (which is quite large) before failing. EDIT: I should clarify, this issue has been fixed in Debian at least for a while; but I just tripped over it again when I was playing with an Ubuntu VM; maybe 16.04?
- waterhouse 7y agoMaybe replace "ssh" with "timeout 10 ssh"? I assume 10 seconds is long enough for ssh to do its thing and short enough that the machine couldn't have come back up.
- sudosysgen 7y agoThat's a hack.