In this post, I describe how to override the default rsyncd settings on a Synology diskstation to enable custom daemon mode modules/shares that don’t require user authentication.
This week I’ve been doing quite a bit of work with Synology Diskstations, particularly in terms of mirroring data across sites. The Diskstations are replacing some older Netgear ReadyNAS boxes, which are a getting a bit full and a bit slow as data size has grown. On the ReadyNAS boxes it was straightforward to set up rsync modules (aka shares) via the web frontend, which is preferable on a secure network connection as it avoids the overhead of running rsync over SSH. It also has the advantage that you can configure shares to be read only, to reduce the risk of inadvertently deleting data.
It’s possible to set up rsync shares in the same way on Synology NAS boxes, but it requires a bit more work. These instructions were tested on some new Diskstations running DSM 5.2.
- Log in to the Synology Diskstation web frontend, usually at http://ip_address:5000/ or https://ip_address:5001/.
- Click the main menu icon in the top left.
- Select Backup & Replication from the menu.
- Select Backup Services in the window that pops up.
- Tick the Enable network backup and the Use customized rsync configuration checkboxes and click Apply.
- Make sure to allow rsync connections through the Diskstation firewall if prompted.
- Now SSH in to the Diskstation (instructions on how to do this are easy to find on the web if you haven’t already enabled SSH).
grep rsync /etc/synoinfo.confand check that
use_rsyncd_confis set to
"yes", including quotes.
- Edit the rsync configuration file as required – it’s in /etc/rsyncd.conf. Example share config info is below.
- Restart the rsync daemon with
/usr/syno/etc.defaults/rc.sysv/S84rsyncd.sh stop && /usr/syno/etc.defaults/rc.sysv/S84rsyncd.sh start.
- Test the share works with a command like
rsync --recursive --dry-run ip_address::share_name/ testfrom a remote machine.
Here is a sample share config section to put into /etc/rsyncd.conf, creating a read-only share that’s accessible without authentication from 192.168.1.1:
path = /volume1/test
comment = "Test share"
uid = root
gid = root
read only = yes
list = yes
charset = utf-8
secrets file = /etc/rsyncd.secrets
hosts allow = 192.168.1.1
References: http://forum.synology.com/enu/viewtopic.php?f=160&t=34661 gave me the first steps required to get this working.