關於rsync中/etc/rsync.password的權限故障:

關於rsync中/etc/rsync.password的權限故障:web

①客戶端故障:ide

[root@nfs01-31 ~]# rsync -avz /backup/ rsync_backup@10.0.0.41::backup/ --password-file=/etc/rsync.password ui

password file must not be other-accessiblespa

continuing without password filecode

Password: server

@ERROR: auth failed on module backupip

rsync error: error starting client-server protocol (code 5) at main.c(1503) [sender=3.0.6]rem

[root@nfs01-31 ~]# ls -ld /etc/rsync.password it

-rwxrwxrwx 1 root root 7 Sep 25 00:10 /etc/rsync.passwordclass

[root@nfs01-31 ~]# 

②客戶端故障:

[root@web01-8 backup]# rsync -avz /backup/ rsync_backup@10.0.0.41::backup/ --password-file=/etc/rsync.password 

password file must not be other-accessible

continuing without password file

Password: 

@ERROR: auth failed on module backup

rsync error: error starting client-server protocol (code 5) at main.c(1503) [sender=3.0.6]

[root@web01-8 backup]# 


③password file must not be other-accessible

其實這句話 就告訴咱們權限有問題的了 


④查看權限:

[root@web01-8 backup]# ls -ld /etc/rsync.password

-rwxrwxrwx 1 root root 7 Sep 25 00:10 /etc/rsync.password

[root@web01-8 backup]# 

[root@nfs01-31 ~]# ls -ld /etc/rsync.password

-rwxrwxrwx 1 root root 7 Sep 25 00:10 /etc/rsync.password

[root@nfs01-31 ~]# 

[root@backup-41 scripts]# ls -ld /etc/rsync.password

-rwxrwxrwx 1 root root 20 Sep 25 00:26 /etc/rsync.password

[root@backup-41 scripts]# 


⑤修改權限:

[root@backup-41 scripts]# chmod 600 /etc/rsync.password

[root@backup-41 scripts]# ls -ld /etc/rsync.password

-rw------- 1 root root 20 Sep 25 00:26 /etc/rsync.password

[root@backup-41 scripts]# 

[root@nfs01-31 ~]# ls -ld /etc/rsync.password

-rw------- 1 root root 7 Sep 25 00:10 /etc/rsync.password

[root@nfs01-31 ~]# 

[root@web01-8 backup]# ls -ld /etc/rsync.password

-rw------- 1 root root 7 Sep 25 00:10 /etc/rsync.password

[root@web01-8 backup]# 


⑥查看效果:

[root@web01-8 backup]#  rsync -avz /backup/ rsync_backup@10.0.0.41::backup/ --password-file=/etc/rsync.password

sending incremental file list


sent 51 bytes  received 8 bytes  118.00 bytes/sec

total size is 0  speedup is 0.00

[root@web01-8 backup]# 

##########################################################################################################################

[root@nfs01-31 ~]# rsync -avz /backup/ rsync_backup@10.0.0.41::backup/ --password-file=/etc/rsync.password

sending incremental file list

./


sent 25 bytes  received 11 bytes  24.00 bytes/sec

total size is 0  speedup is 0.00

[root@nfs01-31 ~]# 

相關文章
相關標籤/搜索