yum install rsync xinetdchkconfig rsync onservice xinetd restartsetenforce 0指定服務啟動參數, 找到包含server_args 的行。
server_args = --daemon --config=/etc/rsyncd/rsyncd.confcd /etc/mkdir rsyncdcd rsyncdtouch /etc/rsyncd/rsyncd.conftouch rsyncd.passwd rsyncd.passwdchmod 600 rsyncd.passwdvi rsyncd.confuid = rootgid = rootuse chroot = noread only = yes#limit access to private LANshosts allow=124.3.1.3/255.255.255.0 11.16.52.249/255.255.255.0hosts deny=*max connections = 5pid file = /var/run/rsyncd.pidsecrets file = /etc/rsyncd/rsyncd.passwd#lock file = /var/run/rsync.lock#motd file = /etc/rsyncd/rsyncd.motd#This will give you a separate log file#log file = /var/log/rsync.log#This will log every file transferred - up to 85,000+ per user, per synctransfer logging = yeslog format = %t %a %m %f %bsyslog facility = local3timeout = 300# MODULE OPTIONS[module]path = /var/www/html/test/list=yesignore errorsauth users = usernamecomment = test# exclude = cache/vi /etc/rsyncd/rsyncd.passwd添加用戶名和密碼
username:passwordvi /etc/sysconfig/iptables在適當位置添加新行
-A INPUT -m state --state NEW -m tcp -p tcp --dport 873 -j ACCEPTrsync -avz --progress username@11.16.52.249::module ./test提示輸入密碼,輸入password。
getenforcenetstat -an | grep 873
http://xxxxxx/Linuxjc/1184804.html TechArticle