1.新建一个名为adminuser的组,组id为40000
[root@456 ~]# groupadd adminuser
[root@456 ~]# groupmod -g 40000 adminuser
[root@456 ~]# tail -3 /etc/group
grp1:x:3334:
grp2:x:3335:
adminuser:x:40000:
2.新建一个名为natasha的用户,并将adminuser作为其附属组
[root@456 ~]# useradd -G adminuser natasha
[root@456 ~]# tail -3 /etc/group
grp2:x:3335:
adminuser:x:40000:natasha
3.新建一个名为harry的用户,并将adminuser作为其附属组
[root@456 ~]# useradd -G adminuser harry
[root@456 ~]# tail -3 /etc/group
adminuser:x:40000:natasha,harry
4.新建一个名为sarah的用户,其不属于adminuser组,并将其shell设置为
不可登陆shell /sbin/nologin
[root@456 ~]# useradd -s /sbin/nologin sarah
[root@456 ~]# tail -5 /etc/passwd
redhat:x:1000:1000:redhat:/home/redhat:/bin/bash
wahaha:x:1111:1001:tashihaha:/home/haha:/sbin/nologin
natasha:x:1112:1112::/home/natasha:/bin/bash
harry:x:1113:1113::/home/harry