1

i've established a vpn-connection. in the vpn i connected to a server via: ssh -X ipadress . then the prompt comes up and i start a script on the server with: sh script . this script will take a very long time, but how can i shutdown my pc without affecting the connection to the sever, or better asked: how can i leave him alone?

thx

2 Answers 2

2

You need to install screen and run it inside of screen (which will replace the controlling ptty) and you'll be able to recover your session when you log back in again.

3
  • +1. you'll want crtl-a D to disconnect screen, and screen -r to reconnect it again.
    – Sirex
    Dec 17, 2010 at 15:47
  • shall i install screen on the server or on my client? Dec 17, 2010 at 15:48
  • Install screen on the server. When you initially connect to the server execute screen to start an instance. Then execute your script command. Then as Sirex stated, do <ctrl-a> followed by a d to disconnect from the screen instance and return to your normal shell from which you can completely exit. When you are ready to reconnect, execute screen -r to reattach. Dec 17, 2010 at 17:32
0

screen (as mentioned above) is a good one, but if you're not too fussed about being able to control the process after running it, you can just do:-

nohup <process> &

Then log out, and the process will stay running.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.