rsync报错: Operation not permitted (1)

简介: [rsync报错:rsync: chgrp “.initial-setup-ks.cfg.jaXlVz” (in backup) failed: Operation not permitted (1)]问题背景:在配置好rsync服务和客户端后,客户端从服务端拉取是正常的,但从客户端推送到服务端报错。a,单独推送目录会报这个错误rsync: recv_generator: mkdir “opt” (in backup) failed: Permission denied (13)

[rsync报错:rsync: chgrp “.initial-setup-ks.cfg.jaXlVz” (in backup) failed: Operation not permitted (1)]

问题背景:在配置好rsync服务和客户端后,客户端从服务端拉取是正常的,但从客户端推送到服务端报错。

a,单独推送目录会报这个错误

rsync: recv_generator: mkdir “opt” (in backup) failed: Permission denied (13)

[root@jxl ~]# rsync -avz aa.txt rsync_backup@192.168.81.230::backup
sending incremental file list
aa.txt
rsync: chgrp ".aa.txt.rn3eFN" (in backup) failed: Operation not permitted (1)
sent 96 bytes  received 125 bytes  442.00 bytes/sec
total size is 3  speedup is 0.01
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]

如果从客户端向服务端推送目录和文件也报错rsync: chgrp “.backup.sh.RwFAWn” (in backup) failed: Operation not permitted (1)。但文件传过去了,目录并没有传过去

[root@nfs01:/opt]# rsync -avz /opt/ rsync_backup@192.168.81.230::backup
Password:
sending incremental file list
./
backup.sh
hejian.txt
services
rsync: chgrp ".backup.sh.RwFAWn" (in backup) failed: Operation not permitted (1)
rsync: chgrp ".hejian.txt.iLqEOb" (in backup) failed: Operation not permitted (1)
rsync: chgrp ".services.vxwJGZ" (in backup) failed: Operation not permitted (1)
sent 136,811 bytes  received 340 bytes  21,100.15 bytes/sec
total size is 697,812  speedup is 5.09
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1178) [sender=3.1.2]

然后检查/backup目录的权限被修改成了550,原来设置的是755,然后把权限修改成755后再重新操作

[root@backup:/backup]# ls -ld /backup/
dr-xr-x--- 3 rsync rsync 312 Sep  1 07:54 /backup/
root@backup:/backup]# chmod 755 /backup/
[root@backup:/backup]# ls -ld /backup/
drwxr-xr-x 4 rsync rsync 324 Sep  1 08:03 /backup/

但修改完后再通过客户端同步,还是报上面的错,并且刚修改的目录权限又变成了550

从网上查询的说是selinux影响,但我检查两台服务器的selinux设置的都是disabled,防火墙也处于关闭状态

[root@backup:/backup]# getenforce
Disabled

经排查是由于-a参数导致的,因为-a是归档模式传输,并保持所有文件属性,等价于-rtopgDl(还没有具体深入研究),可以使用下面这个命令替代

[root@nfs01:/opt]# rsync -rltDvz /opt/ rsync_backup@10.0.0.41::backup

不用-a确实解决了,但是经过检查配置文件发现fake super配置参数写成了fake supper因此导致没有root权限。

因此使用-a必须具备fake supper = yes的配置参数才可以。


目录
相关文章
|
6月前
|
缓存 JavaScript
Error: EPERM: operation not permitted, mkdir ‘C:\Program Files\nodejs‘TypeError: Cannot read proper
Error: EPERM: operation not permitted, mkdir ‘C:\Program Files\nodejs‘TypeError: Cannot read proper
55 0
|
5月前
|
网络安全
完美解决 WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
完美解决 WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!
262 0
|
11月前
|
Oracle 关系型数据库 数据安全/隐私保护
you (oracle) are not allowed to access to crontab because of pam configuraion
you (oracle) are not allowed to access to crontab because of pam configuraion
197 0
未解决:dpkg-source: error: aborting due to unexpected upstream changes, see /tmp/-1.diff.rm5mTN
未解决:dpkg-source: error: aborting due to unexpected upstream changes, see /tmp/-1.diff.rm5mTN
91 0
|
关系型数据库 MySQL 数据安全/隐私保护
MySQL:ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
MySQL:ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
103 0