linux:selinux

文書の過去の版を表示しています。


SELinux

$ getenforce
Enforcing
$ sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28

パーミッシブモードはアクセス拒否はしないが、拒否のログを記録するモードである。

$ sudo setenforce 0

エンフォースモードに戻すには 1 を指定する。

$ sudo setenforce 1
$ sudo vi /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
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted

設定を反映させるためには再起動する必要がある。

$ sudo reboot

CentOS

$ sudo yum remove selinux-policy selinux-policy-targeted

CentOS 7

$ sudo yum remove selinux-policy selinux-policy-targeted
$ sudo yum remove policycoreutils

※ policycoreutils は Gnome デスクトップでは削除できない。 Fedora

$ sudo yum remove selinux-policy selinux-policy-targeted \
setroubleshoot setroubleshoot-plugins setroubleshoot-server \
policycoreutils policycoreutils-python
  • linux/selinux.1437460354.txt.gz
  • 最終更新: 2019/05/18 02:23
  • (外部編集)