用户

添加用户user01

useradd user01

useradd 一些参数

-c, --comment COMMENT 
-G, --groups GROUP1[,GROUP2,...[,GROUPN]]]
-s, --shell SHELL
-u, --uid UID

设置密码

passwd user01

查询用户信息

id user01


添加组sales

groupadd sales

添加用户user01到组sales

usermod -aG sales user01


用户/组关系维护

# Check goup members
getent group root
getent group wheel
getent group sudo
# Add user01 into sudo group
usermod -aG sudo user01
# Remove user01 from sudo group
gpasswd -d user01 sudo