LoginSignup
2
3

More than 5 years have passed since last update.

SELinuxの操作

Last updated at Posted at 2016-09-01

SELinuxの操作

確認環境

「さくらのVPS」 http://vps.sakura.ad.jp/
カスタムOSインストール:CentOS7
での確認となります。

前提

「SELinuxが原因でうまくいかない?」と原因を切り分けるために停止が必要な場合もあるかと思いますが、SELinux停止のリスクをご理解した上での操作をお願いします。

SELinux動作確認

# getenforce
Enforcing

getenforceコマンドでSELinuxの状況を確認できます。

状況 意味
Enforcing 有効
Permissive 無効(ただし警告あり)
Disabled 無効

一時的な無効化/有効化

一時的な無効化

# setenforce 0

実行後、すぐにSELinuxは無効になります。

一時的な有効化

# setenforce 1

実行後、すぐにSELinuxは有効になります。

起動時のSELinux有効・無効設定

/etc/selinux/config を直接編集します。

SELINUX=enforcing ※disableにすると無効

再起動後に有効となります。

謝辞

以下を参考にしました。ありがとうございます。

selinuxの無効化
http://www.server-memo.net/centos-settings/selinux/deiabled-selinux.html
SELinuxの設定
http://rfs.jp/server/security/selinux01.html

2
3
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
2
3