Sign up ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

ssh can use to run remote commands.

ssh ''

I run a long script that will take a lot of time, but I want to close my computer and keep running the script in the remote server. I know how to achieve this with GNU Screen, but I need do it via ssh.

Can I do that without interrupting my script?

share|improve this question
What's wrong with starting screen on the remote server? – choroba Jan 19 '12 at 14:52

3 Answers 3

up vote 5 down vote accepted

Use "nohup" to run a command immune to hangups, with output to a non-tty:

nohup your_command &

and to run a command via ssh, without first logging into the remote machine:

ssh user_name@machine_address "nohup" &
share|improve this answer

ssh user@server "nohup >/var/log/output.log 2>&1 &"

That should run the remote command without leaving a running ssh process on your client.

share|improve this answer
$ ssh screen -dm
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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