Rsync ERROR: auth failed on module解決方法

Rsync 版本
[root@mail video]# rsync –version
rsync version 3.0.6 protocol version 30
Copyright (C) 1996-2009 by Andrew Tridgell, Wayne Davison, and others.
Web site: rsync.samba.org
Capabilities:
64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
append, ACLs, xattrs, iconv, no symtimes
rsync comes with ABSOLUTELY NO WARRANTY. This is free software, and you
are welcome to redistribute it under certain conditions. See the GNU
General Public Licence for details.
服務(wù)器同步任務(wù)需求
服務(wù)器A與服務(wù)器B同步備份,這里只說明服務(wù)器A同步到服務(wù)器B,服務(wù)器B還原到服務(wù)器A。
考慮安全因素,使用普通用戶進(jìn)行同步。
使用cronjob,定時同步。
錯誤提示
錯誤發(fā)生在rsync 3.0.6版本,64位 CentOS5.5 系統(tǒng)。
首頁這篇文章主要解決的錯誤是以下:
@ERROR: auth failed on module ***
rsync error: error starting client-server protocol (code 5) at main.c(1503) [receiver=3.0.6]
*** 是你/etc/rsyncd.conf 中配置的模塊,我這里用
password file must not be other-accessible
continuing without password file
Password:
@ERROR: auth failed on module ***
rsync error: error starting client-server protocol (code 5) at main.c(1503) [receiver=3.0.6]
Rsync 配置
#vi /etc/rsyncd.conf
uid = nobody
gid = nobody
max connections = 4
read only = true
#hosts allow = 202.207.177.180
hosts allow = *
transfer logging = true
log format = %h %o %f %l %b
log file = /var/log/rsyncd.log
slp refresh = 300
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsyncd.lock
[web]
path = /home/admin/public_html
comment = Mirror to Hk server
read only = true
list = false
auth users = lixiphp
[test]
path = /home/admin/domains/test
read only = false
auth users = lixiphp
secrets file = /etc/rsyncd.secrets
配置普通用戶密碼
格式為: username:password
設(shè)置權(quán)限為只讀:
首次啟動rsync
如果提示
使用指令
rm -rf /var/run/rsyncd.pid
重啟已經(jīng)在運(yùn)行的rsync
[root@mail video]# ps -ef | grep rsync
root 27284 1 0 10:26 ? 00:00:00 rsync –daemon –config=/etc/rsyncd.conf
root 30516 29986 0 18:35 pts/3 00:00:00 grep rsync
[root@mail video]# kill -9 27284
[root@mail video]# rsync –daemon –config=/etc/rsyncd.conf
這樣服務(wù)器A配置成功!
服務(wù)器B配置一般錯誤都會發(fā)生在服務(wù)器B,注意這部分的講解!
通過CentOS yum install rsync,安裝rsync服務(wù)。
在rsync安裝之后,運(yùn)行以下指令同步備份:
地址rsync://lixiphp@203.171.237.245/test,lixiphp為服務(wù)器A用戶,203.171.237.245服務(wù)器A IP地址或者域名 test為服務(wù)器A配置模塊
密碼存放在/home/admin/admin_backups/password.rsync,這里存放位置,可自由安排。
password.rsync內(nèi)容格式為: password
設(shè)置權(quán)限為只讀:
解決錯誤
用戶密碼錯誤
@ERROR: auth failed on module test
rsync error: error starting client-server protocol (code 5) at main.c(1503) [receiver=3.0.6]
檢查服務(wù)器A存儲密碼文件和服務(wù)器B密碼文件。
服務(wù)器A密碼文件 /etc/rsyncd.secrets 格式為: username:password
服務(wù)器B密碼文件 password.rsync 格式為:password
文件權(quán)限錯誤
password file must not be other-accessible
continuing without password file
Password:
@ERROR: auth failed on module ***
rsync error: error starting client-server protocol (code 5) at main.c(1503) [receiver=3.0.6]
檢查服務(wù)器A存儲密碼文件和服務(wù)器B密碼文件。
服務(wù)器A密碼文件 /etc/rsyncd.secrets 權(quán)限為600: chmod 600 /etc/rsyncd.secrets
服務(wù)器B密碼文件 password.rsync 權(quán)限為600:chmod 600 password.rsync
定時任務(wù)
內(nèi)容如下:
#/bin/sh
rsync -vzrtopg –progress –delete –password-file=/home/admin/admin_backups/password.rsync rsync://lixiphp@203.171.237.245/test /home/admin/admin_backups/test
添加定時任務(wù):
添加以下內(nèi)容:
每個一分鐘從服務(wù)器A同步到服務(wù)器B!
服務(wù)器B向下備份到服務(wù)器A
請確保服務(wù)器A同步用戶lixiphp,對模塊test所在目錄有讀、寫、執(zhí)行的權(quán)限。
- python錯誤:AttributeError: ''module'' object has no attribute ''setdefaultencoding''問題的解決方法
- Python安裝Imaging報錯:The _imaging C module is not installed問題解決方法
- angularjs指令中的compile與link函數(shù)詳解
- angularjs中的單元測試實(shí)例
- AngularJS入門教程之學(xué)習(xí)環(huán)境搭建
- ANGULARJS中用NG-BIND指令實(shí)現(xiàn)單向綁定的例子
- AngularJS中取消對HTML片段轉(zhuǎn)義的方法例子
- angularjs 處理多個異步請求方法匯總
- angularJS中$apply()方法詳解
- AngularJS語法詳解(續(xù))
- AngularJS實(shí)現(xiàn)表單驗證
- jQuery和AngularJS的區(qū)別淺析
- AngularJS中的模塊詳解
- AngularJS內(nèi)置指令
- AngularJs根據(jù)訪問的頁面動態(tài)加載Controller的解決方案
- angularJS 中input示例分享
- AngularJS表單編輯提交功能實(shí)例
- 對比分析AngularJS中的$http.post與jQuery.post的區(qū)別
- Angularjs制作簡單的路由功能demo
- AngularJS的內(nèi)置過濾器詳解
- AngularJS學(xué)習(xí)筆記之基本指令(init、repeat)
- AngularJS Module方法詳解
相關(guān)文章
基于 ZooKeeper 搭建 Hadoop 高可用集群 的教程圖解
Hadoop 高可用 (High Availability) 分為 HDFS 高可用和 YARN 高可用,兩者的實(shí)現(xiàn)基本類似,但 HDFS NameNode 對數(shù)據(jù)存儲及其一致性的要求比 YARN ResourceManger 高得多,所以它的實(shí)現(xiàn)也更加復(fù)雜,下面給大家詳細(xì)介紹,感興趣的一起看看吧2019-06-06解決xshell連接服務(wù)器報找不到匹配的host?key算法問題
這篇文章主要介紹了xshell連接服務(wù)器報找不到匹配的host?key算法,本文給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下2023-08-08nginx/apache/php隱藏http頭部版本信息的實(shí)現(xiàn)方法
有時候我們需要隱藏我們的服務(wù)器版本信息,防止有心人士的研究,更安全,這里介紹下在nginx/apache/php中如何隱藏http頭部版本信息的方法,有需要的朋友參考下吧2013-06-06手把手教你低成本獲取AlphaSSL通配符泛域名SSL證書2024仍可用
AlphaSSL 是著名數(shù)字證書認(rèn)證機(jī)構(gòu)和SSL證書簽發(fā)商 GlobalSign 旗下的證書品牌,這篇文章主打手把手教你低成本獲取AlphaSSL通配符泛域名SSL證書,需要的朋友可以參考下2024-02-02用 Win2003 架設(shè)郵件服務(wù)器 圖文詳解
很多企業(yè)局域網(wǎng)內(nèi)都架設(shè)了郵件服務(wù)器,用于進(jìn)行公文發(fā)送和工作交流。但使用專業(yè)的企業(yè)郵件系統(tǒng)軟件需要大量的資金投入,這對于很多企業(yè)來說是無法承受的2012-10-10