Rsync over SSH with key

Create a new ssh key pair:

ssh-keygen -t rsa -b 2048 -f ufnec-rsync-key

Move the public key to remote server

scp ufnec-rsync-key.pub ufnec@192.168.3.8:/home/ufnec


Add the public key to the authorized_key on the remote server:

ssh -l ufnec 192.168.3.8
cat ufnec-rsync-key.pub >> .ssh/authorized_keys

Test the connection:

ssh -l ufnec -i ~/.ssh/ufnec-rsync-key 192.168.3.8

You should not be prompted for a password.

Test the synchronization:

rsync --progress -avP -e "/usr/bin/ssh -i /home/ufnec/.ssh/ufnec-rsync-key" /home/ufnec/photo/ ufnec@192.168.3.8:/home/ufnec/photo/
This entry was posted in Development and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *