SELinuxステータスを表示し、SELinuxを閉じます

1.SELinuxのステータスを確認します。

1.設定ファイルのコマンドcat/etc / selinux / configを表示することで、ステータスを表示できます。

[root@lill ~]# 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 two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted 

SELinuxには、強制(実行中)、許容(実行せずに警告を生成)、無効(クローズ)の3つの状態があることがわかります。

2.次のコマンドで確認することもできます:getenforce

[root@localhost /]# getenforce
Enforcing

3.次のコマンドを使用することもできます。SELinuxステータスパラメータが有効になっている場合は、オープン状態です。

[root@localhost /]# /usr/sbin/sestatus -v
SELinux status:                 enabled

2.SELinuxをオフにします。

1.一時的なシャットダウン(マシンの再起動後の障害):

#setenforce 0设置为permissive模式;setenforce 1 设置为enforcing模式;
setenforce 0                  

2.完全にシャットダウンします(マシンを再起動する必要があります):

sed -i s#SELINUX=enforcing#SELINUX=disabled# /etc/selinux/config

マシンを再起動するだけです

おすすめ

転載: blog.csdn.net/hanxiaotongtong/article/details/124208569