Posts tagged ‘ssh’

Linux: leave process running on remote machine

Sometimes you want to ssh to a machine, leave a process running there and exit. Screen allows you to do that:

$ screen
$ sh myscript.sh
[type Ctrl+a+d to detach window]
$ exit

The process won’t stop even if you close the ssh session.

Setting up OpenSSH public key authentication

First upload your public key to the server you want to log in:

scp .ssh/id_rsa.pub user@1.2.3.4:/home/user

On the server, add the public key file to the authorized_keys file:

cat id_rsa.pub >> .ssh/authorized_keys

Now you can login using public key authentication and you don’t have to enter a password anymore.