2

Imagine that I have a program running in a VPS.

I want to close that VPS (maybe turn off the computer) but keep that program running.

I understand I can use "screen" to do so. But I'm unsure how the syntax works. Let's say that the program name is "sessions". How would I use screen to keep sessions operational even when I've exited from the VPS?

I have tried "screen sessions" but when I exit the program, I get "[screen is terminating]"

Thanks!

1 Answers1

2

If I understand correctly you want to close the connection to your VPS (and not the server itself).

Follow those steps after having logged in to the server:

  • start screen: screen
  • start your command: session
  • detach screen from the ssh-session by pressing ctrl+b then d
  • now you can terminate your ssh-session
  • after logging in again some time later type screen to reattach the screen session to the ssh-session
guntbert
  • 13,134