---
name: "ftpd_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/ftpd_selinux"
---

# ftpd\_selinux(8)

Security-Enhanced Linux policy for ftp daemons.

## NAME

ftpd\_selinux - Security-Enhanced Linux policy for ftp daemons.

## DESCRIPTION

Security-Enhanced Linux provides security for ftp daemons via flexible mandatory access control.

## FILE\_CONTEXTS

SELinux requires files to have a file type. File types may be specified with semanage and are restored with restorecon.  Policy governs the access that daemons have to files.

- Allow ftp servers to read the /var/ftp directory by adding the public\_content\_t file type to the directory and by restoring the file type.

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

- **restorecon -F -R -v /var/ftp**

  - Allow ftp servers to read and write /var/tmp/incoming by adding the public\_content\_rw\_t type to the directory and by restoring the file type. This also requires the allow\_ftpd\_anon\_write boolean to be set.

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

- **restorecon -F -R -v /var/ftp/incoming**

  ## BOOLEANS

SELinux policy is based on least privilege required and may also be customizable by setting a boolean with setsebool.

- Allow ftp servers to read and write files with the public\_content\_rw\_t file type.

  **setsebool -P allow\_ftpd\_anon\_write on**

- Allow ftp servers to read or write files in the user home directories.

  **setsebool -P ftp\_home\_dir on**

- Allow ftp servers to read or write all files on the system.

  **setsebool -P allow\_ftpd\_full\_access on**

- Allow ftp servers to use cifs for public file transfer services.

  **setsebool -P allow\_ftpd\_use\_cifs on**

- Allow ftp servers to use nfs for public file transfer services.

  **setsebool -P allow\_ftpd\_use\_nfs on**

- 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), [ftpd(8)](/ftpd/8.md), [setsebool(8)](/setsebool/8.md), [semanage(8)](/semanage/8.md), [restorecon(8)](/restorecon/8.md)
