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

Les Mikesell lesmikesell at gmail.com
Wed Sep 20 15:12:24 UTC 2006


On Wed, 2006-09-20 at 09:41 -0500, 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)?

You can't reconnect to a broken ssh connection, and in fact it
should have killed all the processes you were running.  However,
some editors will save your work when terminated abnormally and
let you recover in a different session.  For example, if you used
vi filename
and were disconnected, you could recover later with
vi -r filename
I don't know anything about nano, though.

-- 
  Les Mikesell
   lesmikesell at gmail.com





More information about the CentOS mailing list