Skip to main content

Keeping a process running after SSH has been closed

Jose CerrejonLess than 1 minuteLinuxLinux

Keeping a process running after SSH has been closed

bash
bash

It is a question that has been asked by a guy in a Slack channel and piqued my curiosity. Thanks to DuckDuckGoopen in new window the answer came alone:

# Instead of running a process as,
$ proc &
# Try to use:
$ nohup proc &

The nohup will prevent the process from being terminated when the terminal disconect. Another solution is using the screen command. You have some examples at thegeekstuff.comopen in new window.