Use SSH to start a background process on a remote server, and exit session

The “-f” option to ssh tells ssh to run the remote command in the background and to return immediately. E.g.,

ssh -f user@host "echo foo; sleep 5; echo bar"

If you type the above, you will get your shell prompt back immediately, you will then see “foo” output. Five seconds later you will then see “bar” output. In the meantime, you could have been using the shell.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)