[root@localhost root]#groupadd test
//创建test组
![](https://s1.51cto.com/attachment/201001/201001161263618476015.jpg)
[root@localhost root ]#useradd –g test test1
//
在
test
组中创建
test1
用户
![](https://s1.51cto.com/attachment/201001/201001161263618510500.jpg)
[root@localhost root]#passwd test1
//
设置
test1
的密码
,
密码为:
123456
![](https://s1.51cto.com/attachment/201001/201001161263618536437.jpg)
[root@localhost root]#reboot
//
重新启动
,
输入用户
test1
,密码
:123456
![](https://s1.51cto.com/attachment/201001/201001161263618574343.jpg)
Localhost login:test1
Password:123456
[test1@localhost test1]$
![](https://s1.51cto.com/attachment/201001/201001161263618605390.jpg)
[test1@localhost test1]$exit
//
退出
test1
用户
Localhost login:root
Password:123456
//
输入超级用户
root
,密码
[root@localhost root]#userdel test1
//
删除刚才创建的用户
![](https://s1.51cto.com/attachment/201001/201001161263618635656.jpg)
[root@localhost root]#groupdel test
//
删除创建的
test
组
![](https://s1.51cto.com/attachment/201001/201001161263618667281.jpg)
[root@localhost root]#who
//
列出所有正在使用系统的用户
![](https://s1.51cto.com/attachment/201001/201001161263618700843.jpg)
[root@localhost root]#whoami
//
列出当前用户
![](https://s1.51cto.com/attachment/201001/201001161263618741140.jpg)
[root@localhost root]#w
//
显示谁登陆系统并且在做什么
![](https://s1.51cto.com/attachment/201001/201001161263618798343.jpg)
更深入学习请点击:顶嵌技术交流网
转载于:https://blog.51cto.com/chenboqiang/266439