How to reattach to a screen

Lets suppose you are connected – via the VPN – with screen in a remote server when you lost your connection, the VPN is down and your screen session still attached in the remote server. How to get back the unattached screen? First, redo your login, reopen your ssh and get back access to your remote server.

After restore your connection, you should use screen to list session still attached:

[root@localhost ~]# screen -ls
There is a screen on:
         16176.pts-0.localhost    (Attached)
1 Socket in /var/run/screen/S-root.

Now is simple, just call screen with -U -R to get back your session:

[root@localhost ~]# screen -U -R

And you will be back on track ;-)

About Carlos Costa

My name is Carlos Roberto do Nascimento Costa, but you should call me Carlos Costa. I am Free and Open Source Software activist working as Software Engineer and Consulting.
This entry was posted in en_US. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>