SELinuxを停止させる
■SELinuxの状態を確認する。
[bibo-roku@localhost ~]$ sudo vi /usr/sbin/getenforce
Enforcing ←機能している。
|
|
SELinuxはセキュリティ管理するモジュールですが、強力なアクセス制限によってインストール作業や運用で邪魔になることがあるとのことで、慣れるまでとりあえず止めておきます。
手順を間違えるとカーネルパニックを起こすことがあるらしいので注意とのこと。
■「/boot/grub/grub.conf」のバックアップ及び編集。
[bibo-roku@localhost ~]$ sudo cp /boot/grub/grub.conf grub.conf.bak ←バックアップ作成。
[bibo-roku@localhost ~]$ sudo vi /boot/grub/grub.conf ←編集。
下記「grub.conf」ファイル編集。
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/mapper/VolGroup-lv_root
# initrd /initrd-[generic-]version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title CentOS 6 (2.6.32-504.el6.i686)
root (hd0,0)
kernel /vmlinuz-2.6.32-504.el6.i686 ro root=/dev/mapper/VolGroup-lv_root rd_NO_LUKS rd_NO_MD rd_LVM_LV=VolGroup/lv_swap crashkernel=auto KEYBOARDTYPE=pc KEYTABLE=jp106 rd_LVM_LV=VolGroup/lv_root LANG=ja_JP.UTF-8 rd_NO_DM rhgb quiet enforcing=0 ←追記する。
initrd /initramfs-2.6.32-504.el6.i686.img
|
|
「rhgb quiet」を検索しその後にスペースを挟んで「enforcing=0」を追加して保存する。
■「/etc/selinux/config のバックアップ及び編集。
[bibo-roku@localhost ~]$ sudo cp /etc/selinux/config config.bak
下記「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=disable ←追記する。
|
|
「SELINUX=enforcing」を探し#を付けてコメントアウトしす。
「#SELINUX=enforcing」
その次の行あたりに「SELINUX=disable」を書き加えます。
■reboot する。
[bibo-roku@localhost ~]$ sudo reboot
|
|
OSの再起動が伴うので注意が必要です。
■再度SELinuxの状態を確認する。
[bibo-roku@localhost ~]$ sudo getenforce
[sudo] password for bibo-roku:
Permissive ←「SELinux のポリシーは適用されるが制限はかからない状態」
|
|
Disabled の場合は「SELinux が無効」です。
「VirtualBox」を使用しているので、この辺でやり直しができる「スナップショット」をかけておきます。
2015-04-18 03:30
nice!(0)
コメント(0)
トラックバック(0)
共通テーマ:パソコン・インターネット
コメント 0