SSH is a secure communications protocol that allows you to access your computer from another. When you disconnect from your computer, your SSH session will be terminated. To keep your SSH session running when you disconnect, follow these steps:

  1. Log out of your computer.
  2. Connect to your computer using SSH and enter the following command: ssh -l root@localhost

You’ll need to make sure that screen is installed on the server you are connecting to. If that server is Ubuntu or Debian, just use this command:

Now you can start a new screen session by just typing screen at the command line. You’ll be shown some information about screen. Hit enter, and you’ll be at a normal prompt.

To disconnect (but leave the session running)

To reconnect to an already running session

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

To create a new window inside of a running screen session

To switch from one screen window to another

To list open screen windows

There’s lots of other commands, but those are the ones I use the most.