Rudy Ruckerの同名の著書とは直接関係ありませんが、私の思考の道具箱であることは確かです。大抵のページは書きかけで、内容も不完全ですのでご注意を。

無効にしていたSELinuxを有効にするには?
How do I enable SELinux if I had it disabled?
http://danwalsh.livejournal.com/21868.html のいいかげんな訳

SELinuxを無効にするという無間地獄から脱するために、初めてSELinxを有効にしようとしたとする。これがその手順だ。
Say you want to leave the dark side of SELinux disabled and you want to turn it on for the first time. Here are the steps to enable it.

まず、/etc/selinux/configファイルを編集するか、system-config-selinuxコマンドを使って、マシンをenforcingかpermissiveの状態に変える必要がある。
You need to edit the /etc/selinux/config file or use system-config-selinux and change the machine to enforcing or permissive.

もし、マシンが長期間、もしくは全くラベル付けされていなかった場合、まずはpermissiveの状態にして再起動することになるだろう。再起動の途中で、自動的に(再)ラベル付けがなされる。一方、enforcingの状態で起動すると、udevやmountといったドメインで権限の違反が起こり、ラベル付けをする前にエラーになってしまう可能性が高いのだ。
If the machine was never labeled or not for a very long time you will probably need to boot in permissive mode. The boot sequence will automatically trigger a relabel, but in enforcing mode there is a good chance that some confined domain (udev?, mount?) will get denied before the system gets a chance to fix the labels.

もし、enforcingの状態で起動したいなら、/etc/selinux/configのファイルにはenforcingの設定をしながら、ブート時のカーネルパラメータで enforcing=0として起動すればよい。
If you want the machine to be in enforcing mode you can set the flag in the file to enforcing but boot the kernel with the enforcing=0 flag.

では、リブートしてみる。
reboot.

起動中にラベル付けが行われるはずだ。ファイルを1000個ラベル付けするたびに1個の"*"記号が表示される。ディスク上にあるファイルの数によるが、すくなくとも10分かそれ以上かかるだろう。
You should see the machine start the relabeling. The relabeling will output a "*" for each 1000 files it relabels. This should take at least 10 minutes and maybe longer depending on the number of files on your local disks.

起動が完了したら、root権限でログインしてみよう。
Now when the machine finishes booting. You should be ready to login.

Fedora9を使っているなら、(一般ユーザの)ログインの設定は次のようになっているはずだ。
If you are running on Fedora 9 your SELinux login setup should look like

# semanage login -l

Login Name SELinux User MLS/MCS Range

default unconfined_u s0-s0:c0.c1023
root unconfined_u s0-s0:c0.c1023
system_u system_u s0-s0:c0.c1023

上記のようになっていなかった場合には、次のようにコマンドを実行して修正すること。
If you have something different you cab fix it using the following commands:

# semanage user -a -S targeted -P user -R "unconfined_r system_r" -r s0-s0:c0.c1023 unconfined_u
# semanage login -m -S targeted -s "unconfined_u" -r s0-s0:c0.c1023 default
# semanage login -m -S targeted -s "unconfined_u" -r s0-s0:c0.c1023 root
# semanage user -a -S targeted -P user -R guest_r guest_u
# semanage user -a -S targeted -P user -R xguest_r xguest_u

これで、マシンをenforcingの状態にして、通常のユーザ権限でのログインもできるようになる。
Now you can put the machine into enforcing mode and you should be able to login as a normal user, knowing you have SELinux protecting your system.
タグ

Wiki内検索

メニューバーA

ここは自由に編集できるエリアです。

フリーエリア

編集にはIDが必要です