If we want to configure rsync daemon service in openwrt we can follow the next step.
Let’s start by updating packages and installing software (connecting through SSH and using the CLI)
# opkg update # opkg install rsyncd
Please, note you can install the software through the web, you are required to update the files through SSH though
Once we install the software, we will configure couple of things like usernames and passwords, and folders that we will share…
To do so, edit the conf file /etc/rsyncd.conf and add the following content (please, update it to reflect your needs):
# Minimal configuration for rsync daemon # required for init script pid file = /var/run/rsyncd.pid log file = /var/log/rsyncd.log #can be yes or no. comment out what you need. yes is more secure use chroot = no # uid & gid can be valid users or nobody uid = nobody gid = nogroup #can be yes or no. depending on your needs read only = no [share1] path = /mnt/sharedfolder1 comment = Shared folder over Rsync read only = no auth users = user1 secrets file = /etc/rsyncd.secrets [share2] path = /mnt/sharedfolder2 comment = Shared folder2 over Rsync read only = no auth users = user2 secrets file = /etc/rsyncd.secrets
after that, it is time now to create the file rsyncd.secrets with the following content, for instance
user1:S3cur3P4ssw0rd1! user2:S3cur3P4ssw0rd2!
Time now to start the service:
# /etc/init.d/rsyncd restart
Check everything is in place (port is open and app is running):
# netstat -an | grep 873 tcp 0 0 0.0.0.0:873 0.0.0.0:* LISTEN # ps | grep rsync 1545 root 1844 S /usr/bin/rsync --daemon --no-detach