[CentOS] How to reattach to a failed ssh session or process

Steve Huff shuff at vecna.org
Wed Sep 20 15:03:32 UTC 2006

On Sep 20, 2006, at 10:41 AM, Erick Perez wrote:

> Hi, is there a way to "reconnect" to a ssh session that was
> disconnected and left running processes in the linux server?
> I know that's the purpose of the screen command, but just to spread
> know-how, is that possible?
> Example:
> 3441 pts/0    S+     0:00 nano /etc/httpd/conf/httpd.conf
> I remotely connect to a machine via ssh and started to edit apache
> conf and i did not used screen (me bad). The session timed out due to
> an internet glitch and I got disconnected.
> How can I reattach (speaking in screen terms) to that ssh session or
> gain control to the nano process (or any other)?

if you didn't start an instance of screen to begin with, you're out  
of luck; screen can't help you reattach to any arbitrary process,  
only to other instances of screen.

does nano have a robust autosave/autorecover facility?  if it does,  
just kill the nano process and start another (perhaps this time from  
within screen).  if not, curse your bad luck and consider using vi  
next time, which can deal with this sort of problem.


If this were played upon a stage now, I could condemn it as an  
improbable fiction. - Fabian, Twelfth Night, III,v

More information about the CentOS mailing list