LoginSignup
0
0

More than 1 year has passed since last update.

[SELinux]無効化しているサーバでは有効化するには再起動が必要?

Posted at

現在の状態

selinuxは無効になっています。

[root@localhost ~]# getenforce 
Disabled

無効化状態ではsetenforceコマンドでは変更できない

Disabled(無効化)状態ではsetenforceコマンドは無効化しているからってことで通らなかったのです

[root@localhost ~]# setenforce 0
setenforce: SELinux is disabled
[root@localhost ~]# setenforce 1
setenforce: SELinux is disabled

設定ファイルの変更

大人しく設定ファイルの変更をします。

vi /etc/selinux/config 
==========
SELINUX=disabled
↓
SELINUX=enforcing
==========
[root@localhost ~]# reboot

有効化されました。

[root@localhost ~]# getenforce 
Enforcing

selinuxのログの話

SELinuxのログは /var/log/audit/audit.log に出されています。
enforcing または、permissive の際の許可したログ等はこちらに吐き出されています。

勉強後イメージ

無効化→一時有効化は出来ないからrebootしないといけないのか。
特に稼働しているサーバではちょくちょく変えるのは難しいから決めておかないといけない。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0