groups 查看当前登录用户的组内成员 useradd 注:添加用户 adduser 注:添加用户 passwd 注:为用户设置密码 usermod 注:修改用户命令,可以通过usermod 来修改登录名、用户的家目录等等; pwcov 注:同步用户从/etc/passwd 到/etc/shadow pwck 注:pwck是校验用户配置文件/etc/passwd 和/etc/shadow 文件内容是否合法或完整; pwunconv 注:是pwcov 的立逆向操作,是从/etc/shadow和 /etc/passwd 创建/etc/passwd ,然后会删除 /etc/shadow 文件; finger 注:查看用户信息工具 id 注:查看用户的UID、GID及所归属的用户组 chfn 注:更改用户信息工具 su 注:用户切换工具 sudo 注:sudo 是通过另一个用户来执行命令(execute a command as another user),su 是用来切换用户,然后通过切换到的用户来完成相应的任务, 但sudo 能后面直接执行命令,比如sudo 不需要root 密码就可以执行root 赋与的执行只有root才能执行相应的命令;但得通过visudo 来编辑/etc/sudoers来实现; visudo 注:visodo 是编辑 /etc/sudoers 的命令;也可以不用这个命令,直接用vi 来编辑 /etc/sudoers 的效果是一样的; sudoedit 注:和sudo 功能差不多; 2)管理用户组(group)的工具或命令; groupadd 注:添加用户组; groupdel 注:删除用户组; groupmod 注:修改用户组信息 groups 注:显示用户所属的用户组 grpck grpconv 注:通过/etc/group和/etc/gshadow 的文件内容来同步或创建/etc/gshadow ,如果/etc/gshadow 不存在则创建; grpunconv 注:通过/etc/group 和/etc/gshadow 文件内容来同步或创建/etc/group ,然后删除gshadow文件;
3、/etc/skel 目录; # *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 注:是否创用户家目录,要求创建;
5、/etc/default/useradd 文件; (责任编辑:IT) |