rsync:安全优化
[root@Rsync backup]# netstat -lntup|grep rsync
tcp 0 0 0.0.0.0:873 0.0.0.0:* LISTEN 2227/rsync
tcp 0 0 :::873 :::* LISTEN 2227/rsync
[root@Rsync backup]#
对ip进行控制,从内外ip进行访问,再者修改短扣绑定地址:--address=10.0.0.30
[root@Rsync backup]# lsof -i :873
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
rsync 2227 root 3u IPv4 15614 0t0 TCP *:rsync (LISTEN)
rsync 2227 root 5u IPv6 15615 0t0 TCP *:rsync (LISTEN)
[root@Rsync backup]# kill 2227
[root@Rsync backup]# lsof -i :873
[root@Rsync backup]# rsync --daemon --address=10.0.0.30
[root@Rsync backup]# lsof -i :873
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
rsync 2710 root 3u IPv4 19810 0t0 TCP 10.0.0.30:rsync (LISTEN)
[root@Rsync backup]#
绑定后,只有访问10.0.0.30才能够正常使用,而10.0.0.30则是内网IP
rsync关闭进程相关
killall rsync
pkill rsync
kill 'cat /var/run/rsyncd.pid'
kill -HUP 'cat /var/run/rsyncd.pid'
kill -USR2 'cat /var/run/rsyncd.pid'
也可以过滤出来使用kill杀日志:rsync服务端:/var/log/rsync.log