Show Table of Contents
1.4. SELinux の状態とモード
SELinux は、有効もしくは無効の状態とすることができます。無効の場合は、DAC ルールのみが使用されます。有効な場合は、SELinux は以下のいずれかのモードで実行できます。
- Enforcing: SELinux ポリシーが強制されます。SELinux は SELinux ポリシールールに基づいてアクセスを拒否します。
- Permissive: SELinux ポリシーは強制されません。SELinux はアクセスを拒否しませんが、enforcing モードでは拒否されたであろうアクションの拒否がログに記録されます。
enforcing モードと permissive モードの切り替えには、
setenforce
ユーティリティーを使います。setenforce
を使った変更は、再起動されると維持されません。enforcing モードへの変更は、Linux root ユーザーで setenforce 1
コマンドを実行します。permissive モードへの変更は、setenforce 0
コマンドを実行します。現在の SELinux モードを表示するには、以下のように getenforce
ユーティリティーを実行します。
~]# getenforce
Enforcing
~]#setenforce 0
~]#getenforce
Permissive
~]#setenforce 1
~]#getenforce
Enforcing
状態とモードの永続的な変更については、「SELinux の状態とモードの永続的変更」で説明しています。
Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.