Using screen for SSH connections, re-connecting

Posted on 2007-08-07
Last Modified: 2013-12-16
I known that a program called screen can be used to somehow re-connect to ssh sessions, can someone please tell me how to use it.

I use ssh over the Internet and often get disconnected I heard that screen can be used, but I do not understand where it need to be run from, the box I am connectin g(sshing) to , or the machien I am running ssh from?

Question by:markpalinux
    LVL 4

    Accepted Solution

    screen allows you to keep a session open (ssh or else) even if you loose the connection or the terminal given that you run what ever you want in screen.

    what you want to do is the following:

    * install screen on the destination (the machine you ssh to)
    * connect with ssh to the destination
    * start screen
    * use the command line just as usually

    when you get disconnected:

    * reconnect via ssh
    * run screen -r , and you will be connected to the session you started earlier is screen

    if you have multiple screen running, you can choose to which to reconnect
    LVL 15

    Author Comment


    thanks for your help.

    I also found

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Using 'screen' for session sharing, The Simple Edition Step 1: user starts session with command: screen Step 2: other user (logged in with same user account) connects with command: screen -x Done. Both users are connected to the same CLI sessio…
    SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
    Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
    Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now