Show Table of Contents
6.4. デフォルトマッピングの変更
Red Hat Enterprise Linux では、Linux ユーザーはデフォルトで SELinux
__default__ ログインにマッピングされます (このログインは、SELinux unconfined_u ユーザーにマッピングされます)。新規 Linux ユーザーの場合で特に SELinux ユーザーにマッピングされておらず、デフォルトで制限をかけたい場合、デフォルトマッピングを semanage login コマンドで変更します。
例えば以下のコマンドを root で実行して、デフォルトマッピングを
unconfined_u から user_u に変更します。
~]#semanage login -m -S targeted -s "user_u" -r s0 __default__
__default__ ログインが user_u にマッピングされていることを確認します。
~]#semanage login -lLogin Name SELinux User MLS/MCS Range Service __default__ user_u s0-s0:c0.c1023 * root unconfined_u s0-s0:c0.c1023 * system_u system_u s0-s0:c0.c1023 *
新規 Linux ユーザーが作成され、SELinux ユーザーが特定されていない場合、もしくは既存の Linux ユーザーがログインし
semanage login -l 出力からの特定のエントリーに適合しない場合、__default__ ログインの場合のように user_u にマッピングされます。
デフォルトの動作に戻すには、root で以下のコマンドを実行して
__default__ ログインを SELinux unconfined_u ユーザーにマッピングします。
~]#semanage login -m -S targeted -s "unconfined_u" -r s0-s0:c0.c1023 __default__

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.