Stefan
Stefan

Reputation: 1934

rsync daemon and permissions

Problem

I am confused about rsync daemon and permissions. Unfortunately I cannot figure out why I get
rsync: opendir "/." (in share) failed: Permission denied (13) and
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1650) [generator=3.1.2].
Obviously, by searching the web and looking into the manpage of rsync / rsyncd.conf I was not able to solve this issue.

Setup

Here is my /etc/rsyncd.conf owned by root with 644 permissions:

log file = /var/log/rsyncd.log
[share]
     comment = data
     path = /path/to/data
     uid = root
     gid = root
     read only = false
     auth users = syncuser
     secrets file = /etc/rsyncd.secrets

Note, /path/to/data is owned by root with 755 permissions (though random user or syncuser is also not working).
Besides, /etc/rsyncd.secrets has 600 permissions and is owned by root (I also tried 400 though same issue)

syncuser:passwd

To start the service (on CentOS7)

sudo systemctl start rsyncd

A first test as a random user on the host machine running the daemon, (also running with sudo or as syncuser has no effect)

rsync user@host::

returns share data showing that the configuration is fine?!

However

rsync user@host::share

leads to the errors mentioned above.

Tries

Playing with chmod (777) and chown (root:root, random user:user, syncuser:syncuser) of /path/to/data was not changing anything. Moreover I varied uid and gid to nobody but also without success.
Running above rsync command on an actual client, from which I want to ultimately copy data to the host is of course also failing.

So what am I missing here? Any hints are of course highly appreciated.

Upvotes: 2

Views: 4044

Answers (1)

Hung Tran Dinh
Hung Tran Dinh

Reputation: 36

could you check SELinux?

If it is enforced, the directory /path/to/data need to be labeled correctly.

For example, chcon -R -t public_content_t /path/to/data

Upvotes: 2

Related Questions