Category: rsync

Rsync without password on Synology DiskStation

Rsync is a grateful backup utility and not only. I use it to mirror regularly my important and critical folders from my desktop to my Synology DiskStation DS209.
One draw-back is that rsync always asks for a password and makes it uncomfortable to be used in scripts. We see now how to make a backup script and executing it without any password prompt. The solutions comes along a secure SSH connection through RSA keys.  Here is what you need to do.

First, enable SSH in your Synology web interface.

Create RSA keys as described here

Log into your Synology from a terminal

$ ssh root@diskstation_ip

Edit the file /etc/ssh/sshd_config as following:

$ nano /etc/ssh/sshd_config
#RSAAuthentication yes
PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys

Reboot your DiskStation

$ reboot

Now test that effectively you can sync your folder(s) to your DiskStation NetBackup folder, some other common options are used:

$ rsync -av --update --progress --delete --human-readable -e '/usr/bin/ssh' /local_folder_you_want_to_backup root@diskstation_ip:/volume1/NetBackup

WordPress Themes