[jsosug:00044] コマンドラインからsetroubleshoot

アーカイブの一覧に戻る

Yuichi Nakamura himai****@miomi*****
2008年 10月 30日 (木) 21:12:50 JST


中村です。
昨日のセキュアOS塾にて、
setroubleshootをコマンドラインから使う方法について質問がありました。


SELinuxによるトラブルがあると、/var/log/messagesに
↓のようなログが記録されます。

Oct 30 15:20:05 localhost setroubleshoot: SELinux is preventing the httpd from using potentially mislabeled files (/var/www/html/test). For complete SELinux messages. run sealert -l 9637cbb2-a059-4aee-8dbe-8eb376dbbb1b

>  For complete SELinux messages. run sealert -l 9637cbb2-a059-4aee-8dbe-8eb376dbbb1b
と書いてあるので、このコマンドを入れると、トラブルの要約と解決方法が出てきます。

*結果例:

# sealert -l 9637cbb2-a059-4aee-8dbe-8eb376dbbb1b
要約:

SELinux is preventing the httpd from using potentially mislabeled files
(/var/www/html/test).

SELinux has denied httpd access to potentially mislabeled file(s)
(/var/www/html/test). This means that SELinux will not allow httpd to use these
files. It is common for users to edit files in their home directory or tmp
directories and then move (mv) them to system directories. The problem is that
the files end up with the wrong file context which confined applications are not
allowed to access.

アクセスを許可:

If you want httpd to access this files, you need to relabel them using
restorecon -v '/var/www/html/test'. You might want to relabel the entire
directory using restorecon -R -v '/var/www/html'.

<略>

↑の例だと、restorecon -R -v '/var/www/html'
にて問題が解決すると書いてあります。

--
Yuichi Nakamura




Jsosug-users メーリングリストの案内
アーカイブの一覧に戻る