login.defs是设置用户帐号限制的文件,在这里我们可配置密码的最大过期天数,密码的最大长度约束等内容。该文件里的配置对root用户 无效。如果/etc/shadow文件里有相同的选项,则以/etc/shadow里的设置为准,也就是说/etc/shadow的配置优先级高于 /etc/login.defs
#*REQUIRED*
#Directorywheremailboxesreside,_or_nameoffile,relativetothe
#homedirectory.Ifyou_do_defineboth,MAIL_DIRtakesprecedence.
#QMAIL_DIRisforQmail
#
#QMAIL_DIRMaildir
MAIL_DIR/var/spool/mail注:创建用户时,要在目录/var/spool/mail中创建一个用户mail文件;
#MAIL_FILE.mail
#Passwordagingcontrols:
#
#PASS_MAX_DAYSMaximumnumberofdaysapasswordmaybeused.
#PASS_MIN_DAYSMinimumnumberofdaysallowedbetweenpasswordchanges.
#PASS_MIN_LENMinimumacceptablepasswordlength.
#PASS_WARN_AGENumberofdayswarninggivenbeforeapasswordexpires.
#
PASS_MAX_DAYS99999注:用户的密码不过期最多的天数;
PASS_MIN_DAYS0注:密码修改之间最小的天数;
PASS_MIN_LEN5注:密码最小长度;
PASS_WARN_AGE7注:
#
#Min/maxvaluesforautomaticuidselectioninuseradd
#
UID_MIN500注:最小UID为500,也就是说添加用户时,UID是从500开始的;
UID_MAX60000注:最大UID为60000;
#
#Min/maxvaluesforautomaticgidselectioningroupadd
#
GID_MIN500注:GID是从500开始;
GID_MAX60000
#
#Ifdefined,thiscommandisrunwhenremovingauser.
#Itshouldremoveanyat/cron/printjobsetc.ownedby
#theusertoberemoved(passedasthefirstargument).
#
#USERDEL_CMD/usr/sbin/userdel_local
#
#Ifuseraddshouldcreatehomedirectoriesforusersbydefault
#OnRHsystems,wedo.ThisoptionisORedwiththe-mflagon
#useraddcommandline.
#
CREATE_HOMEyes注:是否创用户家目录,要求创建;