Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 have got a little python program which I want to run on my remote sever(Ubuntu). But after closing the ssh-connection the program closes as well.

How do I keep this program running without the ssh-connection?

share|improve this question
Think perhaps you're probably either looking to daemonize your python script, or run process in the background? – James May 2 '13 at 22:15
up vote 1 down vote accepted

A couple of simple things to try -

  1. Add an "&" character to the end of the command line you are running which will background the job and will probably work or

  2. Use the "screen" program - run screen, then the command, then detach your console from screen.

share|improve this answer
Option 1 worked just fine. – Stein May 2 '13 at 22:38

You could use the program screen. Once logged in to the SSH session, type:
screen -S (name)

Then start the process. Disconnect by typing:
Ctrl-A then D

When you want to re attach to this session, SSH back in and type:
screen -r (name)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.