歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> 學習Linux >> centos6.8 安裝配置rsync

centos6.8 安裝配置rsync

日期:2017/3/3 17:45:50   编辑:學習Linux

centos6.8 安裝配置rsync

centos6.8 安裝配置rsync


yum 安裝兩個包

yum install rsync xinetd

打開rsync服務,重啟xinetd服務,關閉SeLinux

chkconfig rsync onservice xinetd restartsetenforce 0

手工配置xinetd服務中rsync的內容

指定服務啟動參數, 找到包含server_args 的行。

server_args     = --daemon --config=/etc/rsyncd/rsyncd.conf

手工創建/etc/syscnd/目錄及文件

cd /etc/mkdir rsyncdcd rsyncdtouch /etc/rsyncd/rsyncd.conftouch rsyncd.passwd rsyncd.passwdchmod 600 rsyncd.passwdvi rsyncd.conf

rsyncd.conf文件內容示例

uid = 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/

配置rsyncd.passwd

vi /etc/rsyncd/rsyncd.passwd

添加用戶名和密碼

username:password

打開防火牆iptables端口

vi /etc/sysconfig/iptables

在適當位置添加新行

-A INPUT -m state --state NEW -m tcp -p tcp --dport 873  -j ACCEPT

rsync命令示例

rsync -avz --progress  [email protected]::module ./test

提示輸入密碼,輸入password。

遇到問題,注意查看系統狀態

getenforcenetstat -an | grep 873

http://xxxxxx/Linuxjc/1184804.html TechArticle

Copyright © Linux教程網 All Rights Reserved