Centos7上rsync安装和配置

服务端:rsyncd.conf配置

[root@server2 ~]# cat /etc/rsyncd.conf

log file = /var/log/rsyncd.log          

pidfile = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
secrets file = /etc/rsync.pass
[etc_from_client]                                 #指定模块名
path = /appdata/ebank/                      #指定同步文件的路径
comment = sync etc from client 
uid = rsync                                          #指定可同步的
gid = rsync                                          
port = 873                                           #监听指定的端口  
ignore errors
use chroot = no
read only = no
list = no
max connections = 200
timeout = 600
auth users = ebank                                 #指定rsync验证的用户,这个用户在系统用户中可以不存在的
hosts allow = 192.168.1.11                     #指定可以联系的客户端主机名或和ip地址或地址段,默认情况没有此参数,即都可以连接
hosts deny = 192.168.1.6                       #指定不可以联系的客户端主机名或ip地址或地址段,默认情况没有此参数,即都可以连接

2、配置rsync的密码文件

# touch  /etc/rsync.pass

ebank:123456

3、客户端配置

创建密码文件  只需要添加密码即可

#touch /etc/rsync.pass

123456

#rsync -avH --port 873 -P XXX [email protected]::etc_from_client --password-file=/etc/rsync.pass                xxx为目录

猜你喜欢

转载自www.cnblogs.com/xiaopaipai/p/12386154.html