/etc/login.defs 文件內容及其解釋


/etc/login.defs 是設置用戶帳號限制的文件。該文件里的配置對root用戶無效。

如果/etc/shadow文件里有相同的選項,則以/etc/shadow里的設置為准,也就是說/etc/shadow的配置優先級高於/etc/login.defs

# *REQUIRED* required
#  Directory where mailboxes reside, _or_ name of file, relative to the
#   home directory.  If you _do_ define both, MAIL_DIR takes precedence.
#   QMAIL_DIR is for Qmail
#
#QMAIL_DIR      Maildir
MAIL_DIR        /var/spool/mail
#創建用戶時,要在目錄/var/spool/mail中創建一個用戶mail文件
#MAIL_FILE      .mail

# Password aging controls:
#
#       PASS_MAX_DAYS   Maximum number of days a password may be used.
#       PASS_MIN_DAYS   Minimum number of days allowed between password changes.
#       PASS_MIN_LEN    Minimum acceptable password length.
#       PASS_WARN_AGE   Number of days warning given before a password expires.
#
PASS_MAX_DAYS   99999
#密碼最大有效期
PASS_MIN_DAYS   0
#兩次修改密碼的最小間隔時間
PASS_MIN_LEN    5
#密碼最小長度,對於root無效
PASS_WARN_AGE   7
#密碼過期前多少天開始提示
#
# Min/max values for automatic uid selection in useradd
#創建用戶時不指定UID的話自動UID的范圍
UID_MIN                   500
#用戶ID的最小值
UID_MAX                 60000
#用戶ID的最大值
#
# Min/max values for automatic gid selection in groupadd
#自動組ID的范圍
GID_MIN                   500
#組ID的最小值
GID_MAX                 60000
#組ID的最大值

#
# 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).
#
#USERDEL_CMD    /usr/sbin/userdel_local
#當刪除用戶的時候執行的腳本

#
# 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.
#
CREATE_HOME     yes
#使用useradd的時候是夠創建用戶目錄

# The permission mask is initialized to this value. If not specified,
# the permission mask will be initialized to 022.
UMASK           077

# This enables userdel to remove user groups if no members exist.
#
USERGROUPS_ENAB yes
#用MD5加密密碼


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM