①客户端故障:
[[email protected] ~]# rsync -avz /backup/ [email protected]::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]
[[email protected] ~]# ls -ld /etc/rsync.password
-rwxrwxrwx 1 root root 7 Sep 25 00:10 /etc/rsync.password
[[email protected] ~]#
②客户端故障:
[[email protected] backup]# rsync -avz /backup/ [email protected]::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]
[[email protected] backup]#
③password file must not be other-accessible
其实这句话 就告诉我们权限有问题的了
④查看权限:
[[email protected] backup]# ls -ld /etc/rsync.password
-rwxrwxrwx 1 root root 7 Sep 25 00:10 /etc/rsync.password
[[email protected] backup]#
[[email protected] ~]# ls -ld /etc/rsync.password
-rwxrwxrwx 1 root root 7 Sep 25 00:10 /etc/rsync.password
[[email protected] ~]#
[[email protected] scripts]# ls -ld /etc/rsync.password
-rwxrwxrwx 1 root root 20 Sep 25 00:26 /etc/rsync.password
[[email protected] scripts]#
⑤修改权限:
[[email protected] scripts]# chmod 600 /etc/rsync.password
[[email protected] scripts]# ls -ld /etc/rsync.password
-rw------- 1 root root 20 Sep 25 00:26 /etc/rsync.password
[[email protected] scripts]#
[[email protected] ~]# ls -ld /etc/rsync.password
-rw------- 1 root root 7 Sep 25 00:10 /etc/rsync.password
[[email protected] ~]#
[[email protected] backup]# ls -ld /etc/rsync.password
-rw------- 1 root root 7 Sep 25 00:10 /etc/rsync.password
[[email protected] backup]#
⑥查看效果:
[[email protected] backup]# rsync -avz /backup/ [email protected]::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
[[email protected] backup]#
##########################################################################################################################
[[email protected] ~]# rsync -avz /backup/ [email protected]::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
[[email protected] ~]#