linuxprocesssshbackground-process

How to prevent a background process from being stopped after closing SSH client in Linux


I'm working on a Linux machine through SSH (Putty). I need to leave a process running during the night, so I thought I could do that by starting the process in background (with an ampersand at the end of the command) and redirecting stdout to a file.

To my surprise, that doesn't work. As soon as I close the Putty window, the process is stopped.

How can I prevent that from happening??


Solution

  • Check out the "nohup" program.