Show Table of Contents
5.12.3. 特別の MLS 範囲を持つユーザーの作成
特別の MLS 範囲を持つ新規 Linux ユーザーを作成するには、以下のステップにしたがいます。
useraddコマンドで新規Linux ユーザーを追加し、このユーザーを既存の SELinux ユーザーにマッピングします (このケースでは、user_u)。~]#
useradd -Z user_u john- 新規作成の Linux ユーザーにパスワードを割り当てます。
~]#
passwd john semanage login -lコマンドを実行し、SELinux ユーザーと Linux ユーザー間のマッピングを表示します。出力は以下のようになります。Login Name SELinux User MLS/MCS Range __default__ user_u s0 john user_u s0 root root s0-s15:c0.c1023 system_u system_u s0-s15:c0.c1023
- ユーザー
johnの特定範囲を定義します。~]#
semanage login --modify --seuser user_u --range s2:c100 john semanage login -lコマンドを実行し、SELinux ユーザーと Linux ユーザー間のマッピングを表示します。ユーザーjohnに特定 MLS 範囲が定義されていることに注意してください。Login Name SELinux User MLS/MCS Range __default__ user_u s0 john user_u s2:c100 root root s0-s15:c0.c1023 system_u system_u s0-s15:c0.c1023
- john のホームディレクトリーのラベルを修正するには、以下のコマンドを実行します (必要な場合)。
~]#
chcon -R -l s2:c100 /home/john

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.