vim /etc/rsyncd/rsyncd.motd
#新增如下内容:
*********************************
Welcome to server 167!
*********************************
修改服务端配置文件 -vim /etc/rsyncd/rsyncd.conf
# Distributed under the terms of the GNU General Public License v2
# Minimal configuration file for rsync daemon
# See rsync(1) and rsyncd.conf(5) man pages for help
# This line is required by the /etc/init.d/rsyncd script
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
secrets file = /etc/rsyncd/rsyncd.secrets
motd file = /etc/rsyncd/rsyncd.motd
port = 873
#指定运行端口,默认是873,您可以自己指定;
address = 192.168.148.167
#指定服务端IP地址
uid = root
gid = root
use chroot = no
read only = yes
#limit access to private LANs
hosts allow=192.168.148.134 192.168.148.168 #以空格分割 客户端IP
hosts deny=*
max connections = 10
#This will give you a separate log file
log file = /var/log/rsync.log
#This will log every file transferred - up to 85,000+ per user, per sync
transfer logging = yes
log format = %t %a %m %f %b
syslog facility = local3
timeout = 300
[www]
path = /wwwroot/data
list=yes
ignore errors = true
auth users = root
#auth users 是必须在服务器上存在的真实的系统用户,如果你想用多个用户以 “,” 号隔开,比如auth users = moTzxx,root
comment = This is moTzxx-comment #提交信息,便于识别
#exclude = file3/ #此处表明,同步文件 除去所有的 file3 目录,如果以斜杠开头,则可指定“path = /server/ftpfile”下的任何目录或文件