How to reconnect to a disconnected ssh session

UPDATE: For an actual answer see zero_r’s answer below

This isn’t an answer, but a workaround. Use screen.

When you first log in, run screen. You get another shell, run commands in that. If you’re disconnected, the screen process keeps the terminal alive so that your shell and the processes it is running don’t fall over. When you reconnect, run ‘screen -r’ to resume.

There’s a bunch more to configuring and using screen, but the above should workaround your problem.

Leave a Comment