1.安装xinetd(rsync daemon由xinetd管理)
yum install xinetd
2.启用rsync daemon
sed -i 's/yes/no/' /etc/xinetd.d/rsync
3.配置rsync
vim /etc/rsyncd.conf
# /etc/rsyncd: configuration file for rsync daemon mode
# See rsyncd.conf man page for more options.
# configuration example:
port = 873
pid file = /var/run/rsyncd.pid
log file = /var/log/rsyncd.log
[sync]
path = 放置文件的目录
use chroot = false
read only = false
uid = root
gid = root
auth users = user
secrets file = /etc/rsyncd.passwd #存放密码的文件
vim /etc/rsyncd.passwd
验证用户:验证密码 #格式
4.启动rsync daemon
service xinetd restart
5.测试
客户端:vim /etc/rsyncd.passwd #写入步骤三中的密码
进行文件同步测试:
rsync -avzcR --password-file=/etc/rsyncd.passwd dir user@IP::sync
网友评论