ftpd_selinux(8)
π¦ ftpd_selinux(8) β SELinux Policy ftpd π¦
πΈ NAME πΈ
ftpd_selinux β Security Enhanced Linux Policy for the ftpd processes π
β¨ DESCRIPTION β¨
Security-Enhanced Linux secures the ftpd processes via flexible mandatory access control. Like, that's the whole point, bestie β mandatory access control is doing the heavy lifting here.
The ftpd processes execute with the ftpd_t SELinux type. You can check if you have these processes running by executing the ps command with the -Z qualifier.
For example:
ps -eZ | grep ftpd_t
πͺ ENTRYPOINTS πͺ
The ftpd_t SELinux type can be entered via the ftpd_exec_t file type.
The default entrypoint paths for the ftpd_t domain are the following:
/usr/bin/ftpwho, /usr/bin/vsftpd, /usr/bin/in.ftpd, /usr/bin/proftpd,
/usr/bin/muddleftpd, /usr/kerberos/sbin/ftpd, /etc/cron.monthly/proftpd
𧬠PROCESS TYPES π§¬
SELinux defines process types (domains) for each process running on the system.
You can see the context of a process using the -Z option to ps.
Policy governs the access confined processes have to files. SELinux ftpd policy is very flexible, allowing users to setup their ftpd processes in as secure a method as possible.
The following process types are defined for ftpd:
ftpd_tftpdctl_t
Note:semanage permissive -a ftpd_tcan be used to make the process typeftpd_tpermissive. SELinux does not deny access to permissive process types, but the AVC (SELinux denials) messages are still generated. π
ποΈ BOOLEANS ποΈ
SELinux policy is customizable based on least access required. ftpd policy is extremely flexible and has several booleans that allow you to manipulate the policy and run ftpd with the tightest access possible. So iconic of it, honestly.
ftpd_connect_all_unreservedβ if you want to determine whetherftpdcan connect to all unreserved ports, you must turn on theftpd_connect_all_unreservedboolean. Disabled by default.
setsebool -P ftpd_connect_all_unreserved 1
ftpd_connect_dbβ if you want to determine whetherftpdcan connect to databases over the TCP network, you must turn on theftpd_connect_dbboolean. Disabled by default.
setsebool -P ftpd_connect_db 1
ftpd_full_accessβ if you want to determine whetherftpdcan login to local users and can read and write all files on the system, governed by DAC, you must turn on theftpd_full_accessboolean. Disabled by default.
setsebool -P ftpd_full_access 1
ftpd_use_cifsβ if you want to determine whetherftpdcan use CIFS used for public file transfer services, you must turn on theftpd_use_cifsboolean. Disabled by default.
setsebool -P ftpd_use_cifs 1
ftpd_use_fusefsβ if you want to allowftpdto use ntfs/fusefs volumes, you must turn on theftpd_use_fusefsboolean. Disabled by default.
setsebool -P ftpd_use_fusefs 1
ftpd_use_nfsβ if you want to determine whetherftpdcan use NFS used for public file transfer services, you must turn on theftpd_use_nfsboolean. Disabled by default.
setsebool -P ftpd_use_nfs 1
ftpd_use_passive_modeβ if you want to determine whetherftpdcan bind to all unreserved ports for passive mode, you must turn on theftpd_use_passive_modeboolean. Disabled by default.
setsebool -P ftpd_use_passive_mode 1
daemons_dontaudit_schedulingβ if you want to dontaudit all daemons scheduling requests (setsched,sys_nice), you must turn on thedaemons_dontaudit_schedulingboolean. Enabled by default.
setsebool -P daemons_dontaudit_scheduling 1
fips_modeβ if you want to allow all domains to execute infips_mode, you must turn on thefips_modeboolean. Enabled by default.
setsebool -P fips_mode 1
kerberos_enabledβ if you want to allow confined applications to run with kerberos, you must turn on thekerberos_enabledboolean. Enabled by default.
setsebool -P kerberos_enabled 1
nis_enabledβ if you want to allow system to run with NIS, you must turn on thenis_enabledboolean. Disabled by default.
setsebool -P nis_enabled 1
use_nfs_home_dirsβ if you want to support NFS home directories, you must turn on theuse_nfs_home_dirsboolean. Enabled by default.
setsebool -P use_nfs_home_dirs 1
use_samba_home_dirsβ if you want to support SAMBA home directories, you must turn on theuse_samba_home_dirsboolean. Disabled by default.
setsebool -P use_samba_home_dirs 1
π PORT TYPES π
SELinux defines port types to represent TCP and UDP ports.
You can see the types associated with a port by using the following command:
semanage port -l
Policy governs the access confined processes have to these ports. SELinux ftpd policy is very flexible, allowing users to setup their ftpd processes in as secure a method as possible.
The following port types are defined for ftpd:
ftp_data_port_tβ Default Defined Ports:tcp 20ftp_port_tβ Default Defined Ports:tcp 21,989,990andudp 989,990
ποΈ MANAGED FILES ποΈ
The SELinux process type ftpd_t can manage files labeled with the following file types. The paths listed are the default paths for these file types. Note the processes UID still need to have DAC permissions. No cap. π§’
cifs_tβ managed byftpd_t.cluster_conf_t
/etc/cluster(/.*)?
cluster_var_lib_t
/var/lib/pcsd(/.*)?
/var/lib/cluster(/.*)?
/var/lib/openais(/.*)?
/var/lib/pengine(/.*)?
/var/lib/corosync(/.*)?
/usr/lib/heartbeat(/.*)?
/var/lib/heartbeat(/.*)?
/var/lib/pacemaker(/.*)?
cluster_var_run_t
/run/crm(/.*)?
/run/cman_.*
/run/rsctmp(/.*)?
/run/aisexec.*
/run/heartbeat(/.*)?
/run/pcsd-ruby.socket
/run/corosync-qnetd(/.*)?
/run/corosync-qdevice(/.*)?
/run/pcsd.socket
/run/corosync.pid
/run/cpglockd.pid
/run/rgmanager.pid
/run/cluster/rgmanager.sk
faillog_t
/var/log/btmp.*
/run/faillock(/.*)?
/var/log/faillog.*
/var/log/tallylog.*
ftpd_lock_t
/run/lock/subsys/*.ftpd
ftpd_tmp_tβ managed byftpd_t.ftpd_tmpfs_tβ managed byftpd_t.ftpd_var_run_t
/run/proftpd.*
fusefs_t
/run/user/[0-9]+/gvfs
httpd_user_content_t
/home/[^/]+/((www)|(web)|(public_html))(/.+)?
initrc_var_run_t
/run/sysconfig(/.*)?
/run/utmp
/run/keymap
/run/numlock-on
/run/setleds-on
/run/runlevel.dir
/run/setmixer_flag
/run/bootsplashctl
krb5_host_rcache_t
/var/tmp/krb5_0.rcache2
/var/cache/krb5rcache(/.*)?
/var/tmp/nfs_0
/var/tmp/DNS_25
/var/tmp/host_0
/var/tmp/imap_0
/var/tmp/HTTP_23
/var/tmp/HTTP_48
/var/tmp/ldap_55
/var/tmp/ldap_487
/var/tmp/ldapmap1_0
lastlog_t
/var/log/lastlog.*
/var/lib/lastlog(/.*)?
nfs_tβ managed byftpd_t.non_security_file_typeβ managed byftpd_t.root_t
/sysroot/.aleph-version.json
/sysroot/ostree/deploy/.*-atomic/deploy(/.*)?
/
/initrd
/var/lib/ntp
security_t
/selinux
user_home_t
/home/[^/]+/.+
user_tmp_t
/run/tlog(/.*)?
/run/user/[^/]+
/dev/shm/mono.*
/tmp/.ICE-unix(/.*)?
/tmp/.X11-unix(/.*)?
/dev/shm/pulse-shm.*
/run/user
/tmp/.X0-lock
/tmp/hsperfdata_root
/var/tmp/hsperfdata_root
/home/[^/]+/tmp
/home/[^/]+/.tmp
/run/user/[0-9]+
/tmp/gconfd-[^/]+
var_auth_t
/var/ace(/.*)?
/var/rsa(/.*)?
/var/lib/abl(/.*)?
/var/lib/rsa(/.*)?
/var/lib/pam_ssh(/.*)?
/var/lib/pam_shield(/.*)?
/var/opt/quest/vas/vasd(/.*)?
/var/lib/google-authenticator(/.*)?
wtmpdb_journal_t
/var/lib/wtmpdb/wtmp.db-journal
xferlog_t
/var/log/vsftpd.*
/var/log/xferlog.*
/var/log/proftpd(/.*)?
/var/log/xferreport.*
/var/log/muddleftpd.log.*
/var/log/proftpd.log
/usr/libexec/webmin/vsftpd/webalizer/xfer_log
π·οΈ FILE CONTEXTS π·οΈ
SELinux requires files to have an extended attribute to define the file type.
You can see the context of a file using the -Z option to ls.
Policy governs the access confined processes have to these files. SELinux ftpd policy is very flexible, allowing users to setup their ftpd processes in as secure a method as possible.
π STANDARD FILE CONTEXT π
SELinux defines the file context types for the ftpd, if you wanted to store files with these types in a different paths, you need to execute the semanage command to specify alternate labeling and then use restorecon to put the labels on disk.
semanage fcontext -a -t ftpd_exec_t '/srv/ftpd/content(/.*)?'
restorecon -R -v /srv/myftpd_content
Note: SELinux often uses regular expressions to specify labels that match multiple files.
The following file types are defined for ftpd:
ftpd_etc_tβ set files with theftpd_etc_ttype, if you want to storeftpdfiles in the/etcdirectories.ftpd_exec_tβ set files with theftpd_exec_ttype, if you want to transition an executable to theftpd_tdomain.
Paths:
/usr/bin/ftpwho, /usr/bin/vsftpd, /usr/bin/in.ftpd,
/usr/bin/proftpd, /usr/bin/muddleftpd, /usr/kerberos/sbin/ftpd,
/etc/cron.monthly/proftpd
ftpd_initrc_exec_tβ set files with theftpd_initrc_exec_ttype, if you want to transition an executable to theftpd_initrc_tdomain.
Paths:
/etc/rc.d/init.d/vsftpd, /etc/rc.d/init.d/proftpd
ftpd_keytab_tβ set files with theftpd_keytab_ttype, if you want to treat the files as kerberos keytab files.ftpd_lock_tβ set files with theftpd_lock_ttype, if you want to treat the files asftpdlock data, stored under the/var/lockdirectory.ftpd_tmp_tβ set files with theftpd_tmp_ttype, if you want to storeftpdtemporary files in the/tmpdirectories.ftpd_tmpfs_tβ set files with theftpd_tmpfs_ttype, if you want to storeftpdfiles on a tmpfs file system.ftpd_unit_file_tβ set files with theftpd_unit_file_ttype, if you want to treat the files asftpdunit content.
Paths:
/usr/lib/systemd/system/vsftpd.*, /usr/lib/systemd/system/proftpd.*
ftpd_var_run_tβ set files with theftpd_var_run_ttype, if you want to store theftpdfiles under the/runor/var/rundirectory.ftpdctl_exec_tβ set files with theftpdctl_exec_ttype, if you want to transition an executable to theftpdctl_tdomain.ftpdctl_tmp_tβ set files with theftpdctl_tmp_ttype, if you want to storeftpdctltemporary files in the/tmpdirectories.
Note: File context can be temporarily modified with thechconcommand. If you want to permanently change the file context you need to use thesemanage fcontextcommand. This will modify the SELinux labeling database. You will need to userestoreconto apply the labels. π
π SHARING FILES π
Okay so bestie, 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 contexts 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. That's the whole vibe check.
Wanna let ftpd servers read the /var/ftpd directory? Add the public_content_t file type to the directory and restore the file type. Slay:
semanage fcontext -a -t public_content_t "/var/ftpd(/.*)?"
restorecon -F -R -v /var/ftpd
Wanna let ftpd servers read and write /var/ftpd/incoming? Add the public_content_rw_t type to the directory and restore the file type. You also need to turn on the ftpd_anon_write boolean. Two-step icon behavior:
semanage fcontext -a -t public_content_rw_t "/var/ftpd/incoming(/.*)?"
restorecon -F -R -v /var/ftpd/incoming
setsebool -P ftpd_anon_write 1
And if you want to determine whether ftpd can modify public files used for public file transfer services, listen up: directories/files must be labeled public_content_rw_t, and you must turn on the ftpd_anon_write boolean. Like this:
setsebool -P ftpd_anon_write 1
π οΈ COMMANDS π οΈ
semanage fcontextβ can also be used to manipulate default file context mappings. Very main character of it.semanage permissiveβ can also be used to manipulate whether or not a process type is permissive. Vibes only.semanage moduleβ can also be used to enable/disable/install/remove policy modules. It does it all, periodt.semanage portβ can also be used to manipulate the port definitions.semanage booleanβ can also be used to manipulate the booleans.system-config-selinuxβ is a GUI tool available to customize SELinux policy settings. A whole graphical bestie, if that's your thing π.
β¨ AUTHOR β¨
This manual page was auto-generated using sepolicy manpage. Not me writing it by hand with a glitter pen, but honestly close enough π
.
π SEE ALSO π
Go check out selinux(8), ftpd(8), semanage(8), restorecon(8), chcon(1), sepolicy(8), and setsebool(8). That's the reading list, no cap πβ¨.
This cutie page's source/version is ftpd, dated 26-10-06, and it's serving ftpd_selinux(8) β bye bestie, go label responsibly π«Άπ
π¦ where this page comes from
- opensuse-leap 16.0: selinux-policy-doc 20250627+git412.dbf877ab7-160000.1.1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms