rsync安装

#安装rsync

yum install -y rsync

rpm -ql rsync   #查看相关目录

yum install -y xinetd


vim /etc/xinetd.d/rsync

 disable = no

cat /etc/rsyncd.conf 

uid = root

gid = root

use chroot = no

max connections = 8

pid file = /var/run/rsyncd.pid

lock file = /var/run/rsync.lock

log file = /var/log/rsyncd.log


hosts deny=*

hosts allow=192.168.2.0/255.255.255.0 192.168.6.2


[cookie.com]

uid = www

gid = www

path = /www/cookie.com

ignore errors

read only = no

list = no

auth users = www

secrets file = /etc/rsyncd.passwd


#新建密码文件rsyncd.passwd

cat /etc/rsyncd.passwd

www:eCOVaFZKGv$c3uD\@kvv#PdJjan8vb8u


#文件权限

chmod 600 /etc/rsyncd.conf

chmod 600 /etc/rsyncd.passwd


/etc/init.d/xinetd restart     #重新服务

netstat -luntp | grep 873   #查看端口是否已启动 或 telnet 127.0.0.1 873


#关闭防火墙或对某台机器开放873端口权限即可


你可能感兴趣的:(rsync)