用户管理习题

1.新建用户组,shengchan ,caiwu,jishu
2.新建用户要求如下:
1)tom是shengchan组的附加用户,用户id为2000
2)harry是caiwu组的附加用户,用户组的id为3000
3)leo是jishu组的附加用户,此用户家目录在/mnt/leo中
4)新建admin 用户,此用户不属于以上提到的三个部门
5)新建system用户westos,此用户不能登陆系统,这个用户说明为“stystem westos

[root@localhost ~]# groupadd -g 3000 caiwu
[root@localhost ~]# groupadd shengchan
[root@localhost ~]# groupadd jishu
[root@localhost ~]# useradd -G shengchan -u 2000 tom
[root@localhost ~]# useradd -G 3000  harry
[root@localhost ~]# useradd -G jishu -d /mnt/leo leo
[root@localhost ~]# useradd admin
[root@localhost ~]# useradd -c "system westos" -s /sbin/nologin westos

检验是否建立

[root@desktop2 ~]# id tom
uid=2000(tom) gid=2000(tom) groups=2000(tom),3001(shengchan)
[root@desktop2 ~]# id harry
uid=2001(harry) gid=2001(harry) groups=2001(harry),3000(caiwu)
[root@desktop2 ~]# id leo
uid=2002(leo) gid=2002(leo) groups=2002(leo),3002(jishu)
[root@desktop2 ~]#id admin
uid=2003(admin) gid=2003(admin) groups=2003(admin)
[root@desktop2 ~]# su - westos
This account is currently not available.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值