Modify the Boolean values of various rules in the SElinux policy
setsebool command is used to modify the Boolean values of various rules in the SElinux policy. The setsebool command and getsebool command are a set of tools for SELinux to modify and query Boolean values. SELinux policy and rule management related commands: seinfo command, sesearch command, getsebool command, setsebool command, semanage command.
setsebool [-P] boolean=[0|1]-P: Directly write the setting value to the configuration file, and the setting data will take effect in the future.Allow vsftp anonymous user write access:
setsebool -P allow_ftpd_anon_write=1If you want your ftp user to be able to access your home directory, you need to enable:
setsebool -P ftp_home_dir 1If you want to run vsftpd as a daemon, you need to enable:
setsebool -P ftpd_is_daemon 1You can tell SElinux to stop protecting the vsftpd daemon:
setsebool -P ftpd_disable_trans 1HTTP is set to allow cgi settings:
setsebool -P httpd_enable_cgi 1Allow users HHTP access to their home directory. This setting is limited to the user's home directory homepage:
setsebool -P httpd_enable_homedirs 1
chcon -R -t httpd_sys_content_t ~user/public_htmlAllow httpd to access the terminal:
setsebool -P httpd_tty_comm 1Turn off Selinux’s protection of the httpd process daemon:
setsebool -P httpd_disable_trans 1
service httpd restartAbout updating selinux settings of named and master:
setsebool -P named_write_master_zones 1Turn off named's process daemon protection:
setsebool -P named_disable_trans 1
service named restartSelinux sets the local NFS share to read-only:
setsebool -P nfs_export_all_ro 1SElinux sets the local NFS share to be readable and writable:
setsebool -P nfs_export_all_rw 1If you want to share the remote NFS home directory to the local machine, you need to enable:
setsebool -P use_nfs_home_dirs 1If the Samba server shares directories to multiple domains, you need:
setsebool -P allow_smbd_anon_write=1When the samba server wants to share the home directory:
setsebool -P samba_enable_home_dirs 1If you need to use the home directory of the remote samba server on your local machine:
setsebool -P use_samba_home_dirs 1Turn off selinux's protection of the samba process daemon:
setsebool -P smbd_disable_trans 1
service smb restartWhen allowing rsync other users to write:
setsebool -P allow_rsync_anon_write=1Stop process protection of rsync
setsebool -P rsync_disable_trans 1Allow the system to use kerberos:
setsebool -P allow_kerberos 1When the system is working in nis environment:
setsebool -P allow_ypbind 1