User Management

添加用户

useradd USERNAME

# -d 指定家目录
# -g 指定属组 e.g. useradd -g GROUP USERNAME
# -G 指定附加组
# -s 指定shell

# NAME: create a new user or update default new user information

查看用户ID

id USERNAME


# NAME: print real and effective user and group IDs

修改密码

passwd USERNAME

# 修改当前用户的密码时USERNAME可缺省


# NAME: update user's authentication tokens

删除用户

修改用户账户

修改密码过期时间

新建用户组

删除用户组

切换用户

以其它用户身份执行命令

/etc/passwd

Last updated