Skip to content

Comment on Terminating a Frozen SSH Sessionparent

Comments

~? gets you a list of options ~. terminates the connection

Sometimes plain ~. just doesn't work, depending on what state your connection is in.

~<Ctrl-Z> should suspend the ssh process and drop you back in the shell, where you can "kill %1".

Sometimes plain ~. just doesn't work, depending on what state your connection is in.

I can't imagine what state that would be. It should work even if the remote machine is completely unresponsive.

I agree that it "should", but I've definitely had it not work. It may actually be a problem with the state of my local terminal under macOS. I've had to resort to "kill -9"ing my ssh from another window in some situations.

I can only imagine it appearing it not working by hitting Ctrl-s, which freezes terminal output. Killing ssh wouldn't solve that though. Besides unfreezing it with Ctrl-q, you'd have to kill the whole terminal.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.