useradd
-d, --home HOME_DIR
The new user will be created using HOME_DIR as the value for the user's login directory. The default is to append
the LOGIN name to BASE_DIR and use that as the login directory name. The directory HOME_DIR does not have to exist
but will not be created if it is missing.
-M
Do no create the user's home directory, even if the system wide setting from /etc/login.defs (CREATE_HOME) is set to yes.
修改用户的密码
sudo passwd muhe221
查看所有用户和用户组:
cat /etc/passwd
cat /etc/group
删除一个用户
sudo userdel muhe221
sudo useradd muhe221
删除一个组
sudo groupadd ftpgroup
sudo groupdel ftpgroup
mutian@mutian:/etc$ wc -l group
68 group
mutian@mutian:/etc$ sudo groupadd sx221
[sudo] password for mutian:
mutian@mutian:/etc$ wc -l group
69 group
mutian@mutian:/etc$ sudo groupdel sx221
mutian@mutian:/etc$ wc -l group
68 group