[root@slions_pc2 ~]# cat /etc/login.defs # # Please note that the parameters in this configuration file control the # behavior of the tools from the shadow-utils component. None of these # tools uses the PAM mechanism, and the utilities that use PAM (such as the # passwd command) should therefore be configured elsewhere. Refer to # /etc/pam.d/system-auth for more information. # # *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 # QMAIL_DIR是Qmail邮件的目录,所以可以不设置它 MAIL_DIR /var/spool/mail # 默认邮件根目录,即信箱 #MAIL_FILE .mail # mail文件的格式是.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. # # Password aging controls: PASS_MAX_DAYS 99999 # 密码最大有效期(天) PASS_MIN_DAYS 0 # 两次密码修改之间最小时间间隔 PASS_MIN_LEN 5 # 密码最短长度 PASS_WARN_AGE 7 # 密码过期前给警告信息的时间 # 控制useradd创建用户时自动选择的uid范围 # Min/max values for automatic uid selection in useradd # UID_MIN 1000 UID_MAX 60000 # System accounts SYS_UID_MIN 201 SYS_UID_MAX 999 # 控制groupadd创建组时自动选择的gid范围 # Min/max values for automatic gid selection in groupadd # GID_MIN 1000 GID_MAX 60000 # System accounts SYS_GID_MIN 201 SYS_GID_MAX 999 # # If defined, this command is run when removing a user. # It should remove any at/cron/printjobs etc. owned by # the user to be removed (passed as the first argument). # 设置此项后,在删除用户时,将自动删除用户拥有的at/cron/print等job #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. # 控制useradd添加用户时是否默认创建家目录,useradd -m选项会覆盖此处设置 CREATE_HOME yes # The permission mask is initialized to this value. If not specified, # the permission mask will be initialized to 022. # 设置创建家目录时的umask值,若不指定则默认为022 UMASK 077 # This enables userdel to remove user groups if no members exist. # 设置此项表示当组中没有成员时自动删除该组 # 且useradd是否同时创建同用户名的主组。 USERGROUPS_ENAB yes # Use SHA512 to encrypt password. # 设置用户和组密码的加密算法 ENCRYPT_METHOD SHA512
/usr/bin/gpasswd :administer /etc/group and /etc/gshadow /usr/bin/newgrp :log in to a new group,可用来修改gid,哪怕是正在登陆的会话也可以修改 /usr/bin/sg :execute command as different group ID /usr/sbin/groupadd :添加组 /usr/sbin/groupdel :删除组 /usr/sbin/groupmems :管理当前用户的主组中的成员,root用户则可以指定要管理的组 /usr/sbin/groupmod :modify a group definition on the system /usr/sbin/grpck :verify integrity of group files /usr/sbin/grpconv :无视它 /usr/sbin/grpunconv :无视它 /usr/sbin/pwconv :无视它 /usr/sbin/pwunconv :无视它 /usr/sbin/adduser :是useradd的一个软链接,添加用户 /usr/sbin/chpasswd :update passwords in batch mode /usr/sbin/newusers :update and create new users in batch /usr/sbin/pwck :verify integrity of passsword files /usr/sbin/useradd :添加用户 /usr/sbin/userdel :删除用户 /usr/sbin/usermod :重定义用户信息 /usr/sbin/vigr :edit the group and shadow-group file /usr/sbin/vipw :edit the password and shadow-password file /usr/bin/lastlog :输出所有用户或给定用户最近登录信息