There are several ways to keep a process or program running at the server end even after ending or closing the SSH session.
- Establish the SSH connection.
- To start a screen session, simply type
screenin your console. This will open a screen session, create a new window, and start a shell in that window.
- Now start your desired process or program from the shell or terminal.
- You can detach from the screen session at any time by typing
crtl + aand
crtl + d. This will detach your screen session but leave your processes running. You can now close the SSH session.
- To resume your screen session, establish the SSH connection and type
screen -r. This will resume your screen session, and you can see the output of your process.