Portal Home > Knowledgebase > General > SSH session running

SSH session running

Screen is like a window manager for your console. It will allow you to keep multiple terminal sessions running and easily switch between them - much like the Mac OS and Windows 10 desktop screens. It also protects you from disconnection, because the screen session doesn’t end when you get disconnected - this is very handy if your connect gets borken pipes or unreliable connections.

To make sure screen is installed on the server you are connecting to use the following command:

sudo apt-get install screen

Or with CentOS 5+ 

sudo yum install screen

Now that screen has been installed you can create a new screen session by using the simple command below.


To disconnect but leave the session running in the background:

Press Ctrl+A and then Ctrl+D. You will see the message [detached]

To reconnect to an already running session:

screen -r

To reconnect to an existing session, or create a new one if none exists

screen -D -r

To create a new window inside of a running screen session

Hit Ctrl+A and then C in immediate succession. You will see a new prompt.

To switch from one screen window to another

Hit Ctrl+A and then Ctrl+A in immediate succession.

To list open screen windows

screen -ls

There’s lots of other commands you can use but the above will do most of the common elements of using screen.

Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
IP class (Views: 5070)
Geolocated IP addresse (Views: 2008)
Editing files using VI (Views: 1733)