/etc/login.defs
login.defs是设置用户帐号限制的文件,在这里我们可配置密码的最大过期天数,密码的最大长度约束等内容。该文件里的配置对root用户无效。如果/etc/shadow文件里有相同的选项,则以/etc/shadow里的设置为准,也就是说/etc/shadow的配置优先级高于/etc/login.defs
[root@localhost ~]# cat /etc/login.defs
# *REQUIRED*
#
#
#
# *要求*
#目录驻留的邮箱,或名称的文件,相对于
#主目录。如果你同时定义,邮件目录优先。
# Qmail dir是Qmail
#
#QMAIL_DIR
MAIL_DIR
#MAIL_FILE
# Password aging controls:
#密码老化控制:
#
#
#
#
#
PASS_MAX_DAYS
PASS_MIN_DAYS
PASS_MIN_LEN
PASS_WARN_AGE
#
# Min/max values for automatic uid selection in useradd
#创建用户自动UID选择的最小/最大值
UID_MIN
UID_MAX
#
# Min/max values for automatic gid selection in groupadd
#创建组自动GID选择的最小/最大值
GID_MIN
GID_MAX
#
# If defined, this command is run when removing a user.
# It should remove any at/cron/print jobs etc. owned by
# the user to be removed (passed as the first argument).
#如果定义,该命令运行时删除一个user.应删除/打印/ cron的工作等所拥有的用户被删除(作为第一个参数传递)。
#
#USERDEL_CMD
#
# If useradd should create home directories for users by default
# On RH systems, we do. This option is overridden with the -m flag on
# useradd command line.
#useradd的应该创建用户的主目录,默认情况下,在RH系统,我们做的。此选项是useradd的命令行上使用-m标志覆盖。
#
CREATE_HOME
# The permission mask is initialized to this value. If not specified,
# the permission mask will be initialized to 022.
#权限掩码被初始化为这个值。如果未指定,权限掩码将被初始化为022。
UMASK
# This enables userdel to remove user groups if no members exist.
#这使得userdel删除用户组如果没有成员存在。