Red Hat Training
A Red Hat training course is available for RHEL 8
26.8. 新しく作成されたホームディレクトリーのデフォルト権限設定
新しく作成されたユーザーのホームディレクトリーのパーミッションモードは、/etc/login.defs
ファイルを修正して変更できます。
手順
-
root
として、エディターで/etc/login.defs
ファイルを開きます。 以下のセクションを変更して、HOME_MODE のデフォルトを新規設定します。
# HOME_MODE is used by useradd(8) and newusers(8) to set the mode for new # home directories. # If HOME_MODE is not set, the value of UMASK is used to create the mode. HOME_MODE 0700
デフォルトの 8 進数値 (
0700
) を別の 8 進数値に置き換えます。選択したモードは、ホームディレクトリーのパーミッションの作成に使用されます。- HOME_MODE が設定されている場合は、変更を保存してエディターを終了します。
HOME_MODE が設定されていない場合は、UMASK を変更して、新しく作成されたホームディレクトリーにモードを設定します。
# Default initial "umask" value used by login(1) on non-PAM enabled systems. # Default "umask" value for pam_umask(8) on PAM enabled systems. # UMASK is also used by useradd(8) and newusers(8) to set the mode for new # home directories if HOME_MODE is not set. # 022 is the default value, but 027, or even 077, could be considered # for increased privacy. There is no One True Answer here: each sysadmin # must make up their mind. UMASK 022
デフォルトの 8 進数値 (
022
) を別の 8 進数値に置き換えます。詳細は、ユーザーファイル作成モードマスクを参照してください。- 変更を保存し、エディターを終了します。