---
name: "rsync_selinux"
section: "8"
platform: "linux"
package: "selinux-policy-doc"
version: "2:2.20250213-13~deb13u1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/rsync_selinux"
---

# rsync\_selinux(8)

Security Enhanced Linux Policy for the rsync daemon

## NAME

rsync\_selinux - Security Enhanced Linux Policy for the rsync daemon

## DESCRIPTION

Security-Enhanced Linux secures the rsync server via flexible mandatory access control.

## FILE\_CONTEXTS

SELinux requires files to have an extended attribute to define the file type. Policy governs the access daemons have to these files. If you want to share files using the rsync daemon, you must label the files and directories public\_content\_t.  So if you created a special directory /var/rsync, you would need to label the directory with the chcon tool.

- chcon -t public\_content\_t /var/rsync

  -

  - To make this change permanent (survive a relabel), use the semanage command to add the change to file context configuration:

  - semanage fcontext -a -t public\_content\_t "/var/rsync(/.\*)?"

  - This command adds the following entry to /etc/selinux/POLICYTYPE/contexts/files/file\_contexts.local:

  - /var/rsync(/.\*)? system\_u:object\_r:publix\_content\_t:s0

  - Run the restorecon command to apply the changes:

  - restorecon -R -v /var/rsync/

  ## SHARING FILES

If you want to share files with multiple domains (Apache, FTP, rsync, Samba), you can set a file context of public\_content\_t and public\_content\_rw\_t.  These context allow any of the above domains to read the content.  If you want a particular domain to write to the public\_content\_rw\_t domain, you must set the appropriate boolean.  allow\_DOMAIN\_anon\_write.  So for rsync you would execute:

```
setsebool -P allow_rsync_anon_write=1
```

## BOOLEANS

- system-config-selinux is a GUI tool available to customize SELinux policy settings.

  ## AUTHOR

This manual page was written by Dan Walsh \<dwalsh@redhat.com\>.

## SEE ALSO

[selinux(8)](/selinux/8.md), [rsync(1)](/rsync/1.md), [chcon(1)](/chcon/1.md), [setsebool(8)](/setsebool/8.md), [semanage(8)](/semanage/8.md)
