Advertisement

SSH - small question

Started by September 02, 2004 05:22 PM
3 comments, last by Sneftel 20 years ago
How do I run a program over SSH but keep it running after I close the ssh client?
It depends... one way is to use nohup, which simply disconnects the program from the terminal and keeps it going.

An alternative (specifically for interactive programs) is to use "screen" (if installed), which has the advantage that you can ssh back in later, and see what it's doing.

Read the man pages for them both, obviously.

Mark
Advertisement
screen is awesome! i use it very often. here's a good tutorial:

http://www.cumbria.lug.org.uk/index.php?id=6
Does screen take up another pts device. For example, if you are logged in to pts/2 and you simply do a "csh" at the prompt you'll still be on device pts/2. If you are at the console and open up a new termainl then you get another device pts/3. If you screen, are you still pts/2 or pts/3? I'll have to try screen later but was just curious. You have a potential of leaving a session open a long time which is another reason why I'm asking. If so, root should be able to kill it no matter who ran it right?
screen takes up its own pty, which is allocated when screen starts. That pty remains the same no matter how many times the screen session is detached and reattached.

This topic is closed to new replies.

Advertisement