0

I'm setting up an rsync daemon/client system, and I keep running into a "Permission denied (13)" error. Here's my server-side configuration file:

log file = /tmp/rsync.log
timeout = 300
#port = 2049


[public]
  path = /mnt/public
  read only = false
  list =  yes
  uid = nobody
  gid = nobody
  auth users = public
  secrets file = /etc/rsyncd.secrets
  use chroot = false

The folder in question is rwx for all users, and the folder is owned by user=nobody. Permission is denied regardless of which direction the transfer is going. The password is accepted, so it's not an authentication issue.

When I try to transfer a file from the server to client, the command looks like

rsync  rsync://public@<server>/public/msg.txt .

Where is my server. The exact error is

rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1816) [Receiver=3.2.3]
rsync: link_stat "msg.txt" (in public) failed: Permission denied (13)

When I try to transfer a file from the client to the server, the command looks like

rsync msg.txt  rsync://public@<server>/public/msg.txt

and the exact error looks like

rsync: ERROR: cannot stat destination "msg.txt" (in public): Permission denied (13)
rsync error: errors selecting input/output files, dirs (code 3) at main.c(635) [Receiver=3.1.2]

I'd be grateful for any advice.

7
  • Are the responses in your question from the rsync process on the client? Is there anything in the log file on the server? Could you try coping the file "." from the server to the client?
    – BowlOfRed
    Sep 2 at 0:15
  • 2
    Is selinux enabled? Can you post the output of getenforce?
    – oogway
    Sep 2 at 1:38
  • getenforce returns "Enforcing" Sep 2 at 1:53
  • So selinux is enabled. Now try this: grep denied /var/log/audit/audit.log | grep rsync. If you see any recent entries, there's your problem. In addition, you can check the selinux context of the destination folder, ie ls -lZd /mnt/public
    – oogway
    Sep 2 at 1:54
  • Okay, there are 'denied' entries for rsync in var/log/audit/audit.log. When I switch selinux to passive, rsync works! Weirdly, when I run ls -lZd /mnt/public it always returns drwxrwxrwx. nobody root unconfined_u:object_r:mnt_t:s0 /mnt/public reguardless of the selinux enforcement status. Sep 2 at 2:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.