/etc/login.defs 配置檔案

gaopengtttt發表於2009-03-27

轉自網路

/etc/login.defs 配置檔案;

/etc/login.defs 檔案是當建立使用者時的一些規劃,比如建立使用者時,是否需要家目錄,UID和GID的範圍;使用者的期限等等,這個檔案是可以透過root來定義的;

比如Fedora 的 /etc/logins.defs 檔案內容;

# *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 注:密碼最小長度;
PASS_WARN_AGE 7 注:
#
# Min/max values for automatic uid selection in useradd
#
UID_MIN 500 注:最小UID為500 ,也就是說新增使用者時,UID 是從500開始的;
UID_MAX 60000 注:最大UID為60000;
#
# Min/max values for automatic gid selection in groupadd
#
GID_MIN 500 注:GID 是從500開始;
GID_MAX 60000
#
# 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 ORed with the -m flag on
# useradd command line.
#
CREATE_HOME yes 注:是否創使用者家目錄,要求建立;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7728585/viewspace-580325/,如需轉載,請註明出處,否則將追究法律責任。

相關文章