SELinuxの基本操作をまとめる!

SELinuxの基本操作をまとめます。

SELinuxの設定ファイルの内容を確認する!

SELinuxの設定ファイルの内容を確認します。

1
2
3
4
5
6
7
8
9
10
11
12
13
$ sudo cat /etc/selinux/config
 
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

SELinuxの動作モードを確認する!

SELinuxの動作モードを確認します。Enforcingモードであることが分かります。

1
2
$ sudo getenforce
Enforcing

SELinuxの動作モードを変更する!(Enforcing→Permissive)

SELinuxの動作モードを一時的にPermissiveモードに変更します。

1
2
3
$ sudo setenforce 0
$ sudo getenforce
Permissive

SELinuxの動作モードを変更する!(Permissive→Enforcing)

SELinuxの動作モードがEnforcingモードであること確認します。

1
2
3
$ sudo setenforce 1
$ sudo getenforce
Enforcing

おわりに

SELinuxの同サーモ度の確認と切り替えをコマンドで実施しました。f

関連記事

関連書籍(Amazon)

N/A