激情久久久_欧美视频区_成人av免费_不卡视频一二三区_欧美精品在欧美一区二区少妇_欧美一区二区三区的

服務(wù)器之家:專注于服務(wù)器技術(shù)及軟件下載分享
分類導(dǎo)航

云服務(wù)器|WEB服務(wù)器|FTP服務(wù)器|郵件服務(wù)器|虛擬主機|服務(wù)器安全|DNS服務(wù)器|服務(wù)器知識|Nginx|IIS|Tomcat|

服務(wù)器之家 - 服務(wù)器技術(shù) - 服務(wù)器知識 - Rsync ERROR: auth failed on module解決方法

Rsync ERROR: auth failed on module解決方法

2020-09-01 16:02服務(wù)器技術(shù)網(wǎng) 服務(wù)器知識

今天在兩臺服務(wù)器同步備份在用戶權(quán)限上糾結(jié)了很多,主要關(guān)于這個問題網(wǎng)上的配置方法不一,源自rsync版本不一致,這里簡單總結(jié)下,方便需要的朋友

示意圖:

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。
考慮安全因素,使用普通用戶進行同步。
使用cronjob,定時同步。

錯誤提示

錯誤發(fā)生在rsync 3.0.6版本,64位 CentOS5.5 系統(tǒng)。

首頁這篇文章主要解決的錯誤是以下:

復(fù)制代碼 代碼如下:


@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 中配置的模塊,我這里用

 

復(fù)制代碼 代碼如下:


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

 

復(fù)制代碼 代碼如下:


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

 

配置普通用戶密碼

 

復(fù)制代碼 代碼如下:

[root@mail video]# vi /etc/rsyncd.secrets

 

格式為: username:password

 

復(fù)制代碼 代碼如下:

rsync_user:rsyncofpass

 

設(shè)置權(quán)限為只讀:

 

復(fù)制代碼 代碼如下:

chmod 600 /etc/rsyncd.secrets

 

首次啟動rsync

 

復(fù)制代碼 代碼如下:

rsync –daemon –config=/etc/rsyncd.conf

 

如果提示

 

復(fù)制代碼 代碼如下:

failed to create pid file /var/run/rsyncd.pid: File exists

 

使用指令

rm -rf /var/run/rsyncd.pid

重啟已經(jīng)在運行的rsync

 

復(fù)制代碼 代碼如下:


[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安裝之后,運行以下指令同步備份:

復(fù)制代碼 代碼如下:

rsync -vzrtopg –progress –delete –password-file=/home/admin/admin_backups/password.rsync rsync://[email protected]/test /home/admin/admin_backups/test




地址rsync://[email protected]/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

復(fù)制代碼 代碼如下:

rsyncofpass



設(shè)置權(quán)限為只讀:

復(fù)制代碼 代碼如下:

chmod 600 /home/admin/admin_backups/password.rsync



解決錯誤

用戶密碼錯誤

復(fù)制代碼 代碼如下:


@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)限錯誤

復(fù)制代碼 代碼如下:


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ù)

復(fù)制代碼 代碼如下:

[root@hk admin_backups]# vi backup.sh




內(nèi)容如下:

復(fù)制代碼 代碼如下:


#/bin/sh
rsync -vzrtopg –progress –delete –password-file=/home/admin/admin_backups/password.rsync rsync://[email protected]/test /home/admin/admin_backups/test



添加定時任務(wù):

復(fù)制代碼 代碼如下:

[root@hk admin_backups]# crontab –e



添加以下內(nèi)容:

復(fù)制代碼 代碼如下:

*/1 * * * * /home/admin/admin_backups/backup.sh > /dev/null 2>&1



每個一分鐘從服務(wù)器A同步到服務(wù)器B!

服務(wù)器B向下備份到服務(wù)器A

復(fù)制代碼 代碼如下:

rsync -vzrtopg –progress –delete –password-file=/home/admin/admin_backups/password.rsync /home/admin/admin_backups/test rsync://[email protected]/test



請確保服務(wù)器A同步用戶lixiphp,對模塊test所在目錄有讀、寫、執(zhí)行的權(quán)限。

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 欧美成网| 国产自在线 | 国产日韩在线视频 | 日韩精品中文字幕在线观看 | 国产精品久久久久久久娇妻 | 国产一级二级在线播放 | 国产欧美精品一区二区三区四区 | 在线成人免费观看 | 亚洲视频观看 | 久久久国产视频 | 精品欧美一区二区精品久久 | 羞羞的视频免费在线观看 | 婷婷精品国产一区二区三区日韩 | 免费看一级片 | 国产精品欧美久久久久一区二区 | 国产精品99久久久久久大便 | 亚洲国产精品久久久久久久久久 | 中文字幕综合 | 好吊色37pao在线观看 | 欧美成人鲁丝片在线观看 | 国产成人精品一区二区仙踪林 | 欧美老外a级毛片 | 欧美 国产 综合 | 黄a大片 | 玩偶姐姐在线观看免费 | 色诱亚洲精品久久久久久 | 中国漂亮护士一级a毛片 | 国产成人综合在线视频 | 国产在线播放一区二区 | 国产二区三区在线播放 | 青青草免费观看完整版高清 | 久久久一区二区精品 | 亚洲一区中文字幕 | 国产精品一区二区三区99 | 九九热精品在线视频 | cosplay裸体福利写真 | 一区二区国产在线 | 久久久www成人免费精品 | 精品欧美一区二区精品久久小说 | 日日噜噜噜夜夜狠狠久久蜜桃 | 欧美精品v国产精品v日韩精品 |