Trying to rsync using a separate user “rsync” didn’t work (DSM 6.0.2). I got the error message:
ERROR: module is read only
Workaround: destination directory has to start with “/volume1/…” (not “/var/services/…”)
Full command:
rsync -avz -e ssh /data/dir/ rsync@hostname:/volume1/backup_dir
To get it working using an ssh public key (didn’t work at first):
On the PC:
- Generate a key pair:
ssh-keygen -t rsa -b 2048
- Copy public key to NAS:
ssh-copy-id rsync@hostname
On the NAS:
- in /etc/ssh/sshd_config (don’t know if this is necessary):
PubkeyAuthentication yes AuthorizedKeysFile .ssh/authorized_keys
- Make sure that the rsync home directory has the correct permission settings (also check the .ssh directory as well as the file authorized_keys):
chmod 755 /volume1/homes/rsync chmod 700 /volume1/homes/rsync/.ssh chmod 600 /volume1/homes/rsync/.ssh/authorized_keys