In order to set up rsync
to work without a password, you first need to make sure that you can do so with a password:
rsync /local/path username@/remote/path
If successful, then generate a public/private key pair, but be sure not to give a password:
$ ssh-keygen
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Then copy the public key to the remote host — note that ssh-copy-id
will copy the file to the correct location for you:
ssh-copy-id -i ~/.ssh/id_rsa.pub username@/remote
Make sure that you can ssh
without a password:
ssh jlaudun@/remote
Now try rsync
adding the argument -e ssh
to specify the remote shell to use:
rsync -avz -e ssh /local/path username@/remote/path