故障現象:
今天做rsync遠程同步時,為了從備份源站點中使用免密方式同步檔案,當時在發起端輸入了以下命令,
[root@localhost etc]# rsync -az --delete --password-file=/etc/server.pass backuper@14.0.0.10::wwwroot /opt/
提示了如下報錯:

故障排查和解決方法:
根據報錯提示的英文陳述句進行翻譯:
密碼檔案不能被其他用戶訪問,
原來是密碼檔案只能被屬主讀取和寫入,不能被其他用戶讀取,這是不安全的!
而創建的檔案默認權限是644,需要將其設為600
[root@localhost etc]# ll | grep server.pass
-rw-r--r--. 1 root root 7 9月 10 16:43 server.pass
所以需要輸入以下命令來設定密碼檔案的權限:
[root@localhost etc]# chmod 600 server.pass
[root@localhost etc]# ll | grep server.pass #檢查一下權限是否改變
-rw-------. 1 root root 7 9月 10 16:43 server.pass
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/13348.html
標籤:其他
