Configuring rsync Daemon for Backup Server on CentOS
This article provides a step‑by‑step guide to install, configure, and run an rsync daemon on a backup server, create a dedicated rsync user, set up authentication, and demonstrate file push and pull operations from a client machine.
This guide demonstrates how to set up an rsync daemon on a backup server (IP 192.168.210.85) and configure a client (IP 192.168.210.177) to transfer files securely.
Install rsync
rpm -qa rsync rsync-3.1.2-10.el7.x86_64
Configure /etc/rsyncd.conf
# /etc/rsyncd: configuration file for rsync daemon mode # See rsyncd.conf man page for more options. uid = rsync gid = rsync use chroot = no max connections = 200 pid file = /var/run/rsyncd.pid fake super = yes timeout = 600 lock file = /var/run/rsync.lock log file = /var/log/rsyncd.log ignore errors read only = false list = false hosts allow = 192.168.210.0/24 hosts deny = 0.0.0.0/32 auth users = rsyncback secrets file = /etc/rsyncd.password [backup] path = /backup
Create rsync user and backup directory
useradd rsync -s /sbin/nologin -M
mkdir /backup
chown -R rsync:rsync /backup/
Set up authentication password file
echo "rsyncback:123456" > /etc/rsyncd.password
chmod 600 /etc/rsyncd.password
Verify the password file:
cat /etc/rsyncd.password
Result: rsyncback:123456
Start the rsync daemon
systemctl start rsyncd
Confirm it is listening on port 873:
netstat -nltp | grep :873
Client side operations
Prepare the same password file on the client:
echo "123456" > /etc/rsyncd.password
chmod 600 /etc/rsyncd.password
Push a file to the backup server (using password file)
rsync -avzP /root/case.sh [email protected]::backup --password-file=/etc/rsyncd.password
Output shows successful transfer of case.sh (140 bytes).
Push a file without specifying password file (will prompt)
rsync -avzP /root/case.sh [email protected]::backup
Result: 140 bytes transferred, speedup 2.00.
Pull a file from the backup server
rsync -avz [email protected]::backup /root/hell.py --password-file=/etc/rsyncd.password
The guide ends with a separator line indicating completion.
Practical DevOps Architecture
Hands‑on DevOps operations using Docker, K8s, Jenkins, and Ansible—empowering ops professionals to grow together through sharing, discussion, knowledge consolidation, and continuous improvement.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.