Rsync daemon server-side installation configuration steps
1. Check whether rsync is installed
Rpm-qa rsync
Yum install rsync openssh-clients-y
2. Add user rsync
Useradd rsync-s / sbin/nologin-M
Tail-1 / etc/passwd
3. Configure rsyncd.conf
Vim / etc/rsyncd.conf
# rsync_config___start
# # rsyncd.conf start##
Uid = rsync / / virtual user, remote commands need to use rsync to access the shared directory
Gid = rsync / / Virtual user group
Use chroot = no / / Security
Max connections = 200 / / maximum connections
Timeout = 300 / / timeout setting
Pid file = / var/run/rsyncd.pid
Lock file = / var/run/rsync.lock / / lock the file to avoid conflicts. Avoid simultaneous operations
Log file = / var/log/rsyncd.log / / log
[backup] / / Module name
Path = / backup / / Server-side nfs shared directory
Ignore errors / / ignore errors
Read only = false / / Readable and writable permissions
List = false / / disallowed list, ls
Hosts allow = 172.16.1.0 Compact 24 / / allowed hosts
# hosts allow = 10.0.0.0amp 24
Hosts deny = 0.0.0.0amp 32 / / rejected host
Auth users = rsync_backup / / Virtual user
Secrets file = / etc/rsync.password / / password file
# rsync_config___end
4. Configure rsync_backup user files
Echo "rsync_backup:123123" > / etc/rsync.password
Chmod 600 / etc/rsync.password (set permissions)
5. Create a shared directory and authorize rsync service management
Mkdir backup-p
Chown rsync.rsync / backup
6. Start the rsync service and check
Rsync-daemon
Ps-ef | grep rsync | grep-v grep
Lsof-I: 873
Netstat-lntup | grep 873
7. Join the boot boot
Echo "/ usr/bin/rsync-- daemon" > > / etc/rc.local
Tail-1 / etc/rc.local
Troubleshooting:
Rsync server startup error: failed to create pid file / var/run/rsyncd.pid: File exists
Problem: Rsync server startup error under linux-- > failed to create pid file / var/run/rsyncd.pid: File exists
Solution: rm-rf / var/run/rsyncd.pid; and restart the Rsync service (rsync-daemon)