centos7.6 rsync服务配置

-----------centos7.6 服务端配置---------------

安装rsync服务

yum -y install rsync

编辑配置文件 vim /etc/rsyncd.conf

uid=root
gid=root
max connections=36000
use chroot=no
log file=/var/log/rsyncd.log
pid file=/var/run/rsyncd.pid
lock file=/var/run/rsyncd.lock

[test]
path=/data/rsync/test
ignore errors = yes
read only = no
hosts allow = 192.168.1.0/24
hosts deny = *
auth users = user
secrets file = /etc/rsyncd.passwd

设置使用密码

echo "user:123456" > /etc/rsyncd.passwd

设置密码文件权限,不然会同步失败

chmod 600 /etc/rsyncd.passwd

启动服务,查看状态,设置开机自启动

systemctl start rsyncd

systemctl status rsyncd

systemctl enable rsyncd

------------------------------------------------------------------------

-----------centos7.6 客户端配置---------------

安装rsync服务

yum -y install rsync

编辑密码文件,设置权限

echo "123456" > /etc/rsync.passwd

chmod 600 /etc/rsync.passwd

测试客户端rsync拉

rsync -avz --password-file=/etc/rsync.passwd [email protected]::test /data/test/

测试客户端rsync推

rsync -avz --password-file=/etc/rsync.passwd /data/test/ [email protected]::test

---------------------------------------------------------------------------------------------------

猜你喜欢

转载自www.cnblogs.com/liqing1009/p/13402830.html