Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

How do I connect to ssh debian and running a program and let it continue to run after you finish my connection through ssh.

share|improve this question

2 Answers 2

up vote 5 down vote accepted

You can simply nohup the program you are starting and put it in the background akin to:

nohup > nohup.out 2>&1 &

EDIT as per Thor's suggestion

From non-interactive session:

ssh <hostname> "nohup > nohup.out 2>&1 &"
share|improve this answer
Remember to quote the command, i.e. if the above is cmd=... then use ssh remote "$cmd". – Thor Sep 13 '12 at 13:29

There are at least two way to do that

1) nohup command as already mentioned. Wikipedia has an article about nohup

2) There are two popular terminal multiplexers screen and tmux They enable a number of terminals, each running a separate program. There are a lot of tutorials and how-to about both tools on the Internet, just google

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.