March 14, 2018

Configuration file /etc/login.defs

❑ /etc/login.defs : This mainly stores the configure values used when creating user and  group.
* Useradd command references /etc/login.defs and /etc/default/useradd(Link) when creates an user account.

❑ The contents of login.defs
ConfigureDescription
MAIL_DIR /var/spool/mailThe path of the mailbox.
PASS_MAX_DAYS 99999Maximum password age.
PASS_MIN_DAYS 0Minimum password age.
PASS_MIN_LEN 5Minimum password length.
PASS_WARN_AGE 7Warning period before expiration.
UID_MIN 1000Minimum UID value.
UID_MAX 60000Minimum UID value.
GID_MIN 1000Minimum GID value.
GID_MAX 60000Maximum GID value.
SYS_UID_MIN 201Minimum system UID value.
SYS_UID_MAX 999Maximum system UID value.
SYS_GID_MIN 201Minimum system GID value.
SYS_GID_MAX 999Maximum system GID value.
USERDEL_CMD /usr/sbin/userdel_localThe path to the command used to remove the user account. If the system has /usr/sbin/userdel, it doesn't need to be set.
CREATE_HOME yesyes : When the useradd command is used, the home directory is automatically created even if the -m option is not used.
UMASK 077The umask value that is applied to the home directory.
USERGROUPS_ENAB yes- yes : When a user is created, a group with the same name is created, and the created user uses this group.
* This is called UPG schema.
- no : The created user is set to the GID as the GROUP specified in /etc/default/useradd.
ENCRYPT_METHOD SHA512Algorithm settings for encrypting account passwords. DES, MD5, Blowfish, SHA-256, SHA-512 are available.