I need to reconnecting the putty session, I will tell you one example, I'm installing the python manually in my centos os machine, while I run command make, phyton is compiling to makefile suddenly I lost putty connection and putty session is disconnected, which I reconnect and check terminal and run the command who, I can see there are 2 sessions connected and 1 is idle.


The session is dead, and the SSH server just hasn't timed out yet (default timeouts are insanely high, as they assume a very unreliable network). As a general rule, there's not any way you can directly connect to a disconnected SSH session, just like there's no way to connect to and take-over a session running on a different virtual terminal.

For future usage though, I would suggest looking into the programs screen and/or tmux (not sure which of the two is packaged on CentOS, but if you have both as an option, I would personally recommend screen). Both programs are primarily designed for quickly switching between multiple shells started from a single remote session (in essence, they replicate virtual terminal functionality, but with different key bindings), but they have another rather useful feature: you can disconnect from a screen or tmux instance, keep it running, and reconnect later. By starting a screen (or tmux) session immediately after you log in over SSH with PuTTY, you can then reconnect to that session if the connection gets dropped.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.