search
HomeSystem TutorialLINUXIn-depth analysis of setsebool command

In-depth analysis of setsebool command

Jan 14, 2024 pm 04:51 PM
linuxlinux tutorialRed Hatlinux systemlinux commandlinux certificationred hat linuxlinux video

Introduction The 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. Let us explain in detail how to use the setsebool command.
grammar
setsebool [-P] 布尔值=[0|1]
Options
-P:直接将设置值写入配置文件,该设置数据将来会生效的。
Example Allow vsvtp anonymous user write permission:
setsebool -P allow_ftpd_anon_write=1
If you want your ftp user to be able to access your home directory, you need to enable:
setsebool -P ftp_home_dir 1
If you want to run vsftpd as a daemon, you need to enable:
setsebool -P ftpd_is_daemon 1
HTTP is set to allow cgi settings:
setsebool -P httpd_enable_cgi 1
Allow users to HHTP access their home directories. 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_html
Allow httpd to access the terminal:
setsebool -P httpd_tty_comm 1
Turn off Selinux’s protection of the httpd process daemon:
setsebool -P httpd_disable_trans 1 
service httpd restart
About updating selinux settings of named and master:
setsebool -P named_write_master_zones 1
Close named process daemon protection:
setsebool -P named_disable_trans 1 
service named restart
Selinux sets the local NFS share to read-only:
setsebool -P nfs_export_all_ro 1
SElinux sets the local NFS share to be readable and writable:
setsebool -P nfs_export_all_rw 1
If you want to share the remote NFS home directory to the local machine, you need to enable:
setsebool -P use_nfs_home_dirs 1
If the samba server shares directories to multiple domains, you need:
setsebool -P allow_smbd_anon_write=1
When the samba server wants to share the home directory:
setsebool -P samba_enable_home_dirs 1
If you need to use the home directory of the remote samba server on this machine:
setsebool -P use_samba_home_dirs 1
Turn off selinux’s protection of the samba process daemon:
setsebool -P smbd_disable_trans 1 
service smb restart
Allow rsync when other users write:
setsebool -P allow_rsync_anon_write=1
Allow the system to use kerberos:
setsebool -P rsync_disable_trans 1
When the system is working in nis environment:
setsebool -P allow_ypbind 1

The above is the detailed content of In-depth analysis of setsebool command. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:Linux就该这么学. If there is any infringement, please contact admin@php.cn delete
Warehouse: A GUI for Effortlessly Handling Flatpak AppsWarehouse: A GUI for Effortlessly Handling Flatpak AppsMay 09, 2025 am 11:30 AM

A GUI for Effortless Flatpak Management: Introducing Warehouse Managing a growing collection of Flatpak applications can be cumbersome using only the command line. Enter Warehouse, a user-friendly graphical interface designed to streamline Flatpak a

8 Powerful Linux Commands to Identify Hard Drive Bottlenecks8 Powerful Linux Commands to Identify Hard Drive BottlenecksMay 09, 2025 am 11:03 AM

This article provides a comprehensive guide to identifying and resolving hard drive bottlenecks in Linux systems. Experienced server administrators will find this particularly useful. Slow disk operations can severely impact application performance,

4 Best QR Code Generators for Linux Users4 Best QR Code Generators for Linux UsersMay 09, 2025 am 10:27 AM

Efficient QR code generation tool under Linux system In today's digital world, QR codes have become a way to quickly and conveniently share information, simplifying data access from URLs, texts, contacts, Wi-Fi credentials, and even payment information. Linux users can use a variety of tools to create QR codes efficiently. Let's take a look at some popular QR code generators that can be used directly on Linux systems. QRencode QRencode is a lightweight command line tool for generating QR codes on Linux. It is well-received for its simplicity and efficiency and is popular with Linux users who prefer direct methods. Using QRencode, you can use the URL,

elementary OS 8: A User-Friendly Linux for macOS and Windowselementary OS 8: A User-Friendly Linux for macOS and WindowsMay 09, 2025 am 10:19 AM

Elementary OS 8 Circe: A Smooth and Stylish Linux Experience Elementary OS, a Ubuntu-based Linux distribution, has evolved from a simple theme pack into a fully-fledged, independent operating system. Known for its user-friendly interface, elegant de

40  Linux Commands for Every Machine Learning Engineer40 Linux Commands for Every Machine Learning EngineerMay 09, 2025 am 10:06 AM

Mastering Linux is crucial for any machine learning (ML) engineer. Its command-line interface offers unparalleled flexibility and control, streamlining workflows and boosting productivity. This article outlines essential Linux commands, explained fo

Arch Linux Cheat Sheet: Essential Commands for BeginnersArch Linux Cheat Sheet: Essential Commands for BeginnersMay 09, 2025 am 09:54 AM

Arch Linux: A Beginner's Command-Line Cheat Sheet Arch Linux offers unparalleled control but can feel daunting for newcomers. This cheat sheet provides essential commands to confidently manage your system. System Information & Updates These com

How to Install Scikit-learn for Machine Learning on LinuxHow to Install Scikit-learn for Machine Learning on LinuxMay 09, 2025 am 09:53 AM

This guide provides a comprehensive walkthrough of installing and using the Scikit-learn machine learning library on Linux systems. Scikit-learn (sklearn) is a powerful, open-source Python library offering a wide array of tools for various machine l

How to Install Kali Linux Tools in UbuntuHow to Install Kali Linux Tools in UbuntuMay 09, 2025 am 09:46 AM

This guide explains how to leverage Docker for accessing Kali Linux tools, a safer and more efficient alternative to outdated methods like Katoolin. Katoolin is no longer actively maintained and may cause compatibility problems on modern systems. Do

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version