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 … Read more

Moving an already-running process to Screen

Have a look at reptyr, which does exactly that. The github page has all the information. reptyr – A tool for “re-ptying” programs. reptyr is a utility for taking an existing running program and attaching it to a new terminal. Started a long-running process over ssh, but have to leave and don’t want to interrupt … Read more