Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to be able to start some specific servers (related to a game) on a my VPS (to which I connect through ssh). This is simple, I just connect and execute the command, but this creates some problems.

What I would like to do is:

  • launch it in a way that doesn't depend on SSH (eg. I don't want it to close when I close the SSH session)
  • be able to retrieve the stdin/stdout of the process (this because I can send commands through stdin, but once lost I don't exactly know how I'm supposed to get it back and keep using it)

I think there are many solutions out there which would be a simple and efficient for my problem (without looking for anything too complex)?

share|improve this question
up vote 1 down vote accepted

Using GNU Screen would be an easy choice.

  • Open new screen session with the screen command
  • Execute desired commands
  • Detatch with Ctrl + A - Ctrl + D
  • Exit SSH

Next time you need to reconnect to the screen session, simply run screen -r (resume). If you expect a lot of output, you may want to redirect STDOUT and STDERR to a file in the screen session.

share|improve this answer
    
quite straightforward to use and functional.. thanks, this will be useful! – Jack Feb 10 '11 at 10:05
    
@Jack you're most welcome! – John T Feb 10 '11 at 16:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .