Cleaning up or resuming abandoned sessions
I often SSH into my linux box from work using PuTTY. If I am not running any port forwarding, PuTTY will often drop (or my server, not sure which the timeout comes from) my connection.
Now if I log in again using SSH, my past session (terminal) is still active. Example from PS -A: ... 19669 pts/5 00:00:00 bash 19703 pts/5 00:00:00 man ... I would like to be able to resume or at least kill these guys. 1) can I re-attach to these /dev/pts/# "terminals" using ssh? 2) if I cannot re-attach to them and continue where I left off, what is the best way to kill all the processes on "pts/#"? (didn't see an option in kill for this) Also, while I am posting about hung sessions... I had a "screen" session running, and somehow I locked it up (ctrl-a commands work, but the bash shell in the screen window does not respond. Made sure scroll lock was not on, and tried ctrl-q to wake it up, but no dice. Anyone know of any other way I could have locked up the screen to no respond to commands?) |
Install, learn and use package called screen :) It allows to resume dropped sessions with no consequences from the drop.
|
unfortunately, if you are dropped from putty/ssh session there is no way to reconnect to it (screen is a virtual session and is made for reconnections). You'll have to kill the leftover sessions by using 'ps aux' and killing offending process numbers.
|
All times are GMT -5. The time now is 12:49 AM. |