z0nek

关于我

安装Rsync与xinetd包
$ yum -y install xinetd rsync
修改rsync xinetd配置文件,把disable = yes改成disable = no
$ vi /etc/xinetd.d/rsync
加入以下内容:
全局配置:
secrets file = /etc/rsyncd.secrets
read only = no
list = yes
uid = nobody
gid = nobody
模块配置:
[out]
path = /tmp
hosts allow = 172.16.100.160
hosts deny = 172.16.100.120
此时是可以匿名访问的。
[root@vincent htp-0.5.17]# rsync 172.16.100.134::out
drwxrwxrwt 4096 2016/06/03 21:38:45 .
-r–r–r– 11 2016/05/31 00:37:15 .X0-lock
-rw-r–r– 32 2016/05/30 22:42:34 image.php
1)加入IP限制:
修改host allow为特定IP,那么其他IP连接时提示如下:
[root@vincent htp-0.5.17]# rsync 172.16.100.134::out
@ERROR: access denied to out from unknown (172.16.100.160)
rsync error: error starting client-server protocol (code 5) at main.c(1503) [receiver=3.0.6]
2)加入用户认证:
auth users = vinc
secrets file = /etc/rsyncd.secrets
其中/etc/rsyncd.secrets为密码文件,格式为user:password。并且权限必须是600,不是600的话同样会提示auth failed on module out。

标签:运维安全

评论
© z0nek | Powered by LOFTER