• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

setsebool Command in Linux

by admin

SELinux booleans allow you to change the SELinux policy at runtime without the need to write additional policies. This allows you to change the policy without the need for recompilation, such as allowing services to access NFS volumes.

The setsebool command can be used to modify (switch on or off) the value of a SELinux Boolean at runtime as shown in following command line:

# setsebool ftp_home_dir on

The getsebool command can be used with the -a option to display the list of all SELinux Booleans and their current values as shown in the following command line. The output of this command is passed to a grep filter to narrow down the results:

# getsebool -a

The output of the getsebool -a command can be filtered down using grep as shown in the following command line:

# getsebool -a | grep ftp

setsebool Command Examples

1. To set a boolean value to a particular one, use the following command:

# setsebool [SELinux boolean] [on|off]

Here’s an example command:

# setsebool virt_use_nfs on

This command allows you to change the value of the boolean, but it is not persistent across reboots. To allow persistence, add the -P option to the command line, as follows:

# setsebool -P virt_use_nfs on

2. The setsebool command can be used to modify (switch on or off) the value of a SELinux Boolean at runtime as shown in following command line:

# setsebool ftp_home_dir on

3. Modify runtime value as well as the default values of the SELinux Boolean simultaneously by using the setsebool command with the -P option as shown in the following command line:

# setsebool -P ftp_home_dir on

Filed Under: Linux

Some more articles you might also be interested in …

  1. “az pipelines” Command Examples (Manage Azure Pipelines resources)
  2. docker load: Load Docker images from files or stdin
  3. gnomon Command Examples
  4. How to use execl (example included)
  5. notify-send: command not found
  6. Shell Script to print pyramid of Stars
  7. croc: Send and receive files easily and securely over any network
  8. grumphp Command Examples
  9. jello Command Examples
  10. fzf: Command-line fuzzy finder

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright