Skip to content

Comment on Terminating a Frozen SSH Session

Comments

Am I missing something here ? Surely all the author of the blog post needs to do is put : ServerAliveInterval X ServerAliveCountMax Y In their client ssh config file ? (Where X & Y are values that meet their needs)

The issue is that by the time you learn you need that or that your X and Y didn't suffice, you've already got a hung connection. So, now you want to restart the connection, maybe adding those options, but Ctrl+C is not killing ssh because it's trying to pass that to the server, too. So what do you do? Terminate with `~.`, then you can add `-o ServerAliveInter=X`, etc.

Without the escape sequences, your options are to use another terminal to `kill` the ssh client, or kill the whole terminal and start ssh in another. The problem with the former is that it might imply having to login again into the machine that has the ssh client. The problem with the latter is that you might be in multiple nested ssh sessions after having jumped through various servers, and closing the terminal kills everything instead of just the one that got hung.

AboutSource Built by g1lg1l

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