1, first to turn off firewall iptables and SELinux (service iptables stop Sentenforce 0 temporary shutdown)
2 Change the configuration file/etc/rsyncd.cong specific configuration as follows:
port=873Default Listener Portcan be changed to another: for example: 8730
log file=/var/log/rsync.log//Journal file
PID File=/var/run/rsync.pidProcess Number Storage File
[hu]//module name (custom)
path=/tmp/rsync//directory
Use chroot=yes//Limit Change directory
Max connections=4//maximum number of connections
Read Only=yesRead-only (if it is read-only, the client cannot upload the file to the server)
List=yes//Whether the module name is displayed
uid=root//user used in data transfer
Gid=root//The group name used for data transfer
Auth Users=hu//Set up an account to connect to the server
Secrets file=/etc/rs.passwdSet Password filethe privilege should be 600 or more.
hosts allow=192.168.75.0/255.255.255.0To set allowed host connections
Note: The format of the password file is: user:passwd
echo "/usr/bin/rsync--daemon" >>/etc/rc.local if you want to start the boot every time
Client Operation:
RSYNC-AVZP [email protected]::hu/1/txt./use User "Hu" to copy 1.1 above hu/files to the client's./directory
If the newspaper "cannot find/etc/rs.passwd this file error, should be the file permissions problem, if you use root to change the permissions of this file, and then use the ordinary user to execute this command will not find the file, the workaround can change the permissions 444 or change the owner of the file."
This article is from the "Linux" blog, so be sure to keep this source http://825536458.blog.51cto.com/4417836/1681787
Rsync Service Setup