How to keep running a program on Linux through SSH connection?

162 Views Asked by At

I connect to linux server through ssh like:

ssh [email protected]  

filled password,then I run a long-running program such as:

java -jar abc.jar -Dserver.port=80  

but when I close the ssh connection on my computer,the program running on linux server is closed too.How can I keep the program running after close the ssh connection?

1

There are 1 best solutions below

1
On BEST ANSWER

Try using nohup. Prefixing your command with nohup prevents the command from being aborted if you log out or exit the shell.

nohup java -jar abc.jar -Dserver.port=80 &

This seems to be the simplest method to achieve this.