1.新建一个名为adminuser的组,组id为40000
[root@localhost ~]# groupadd -g 400000 adminuser
[root@localhost ~]# grep ^admi /etc/group
adminuser:x:400000:
2.新建一个名为natasha的用户,并将adminuser作为其附属组
[root@localhost ~]# useradd natasha -G adminuser
[root@localhost ~]# id natasha
uid=1004(natasha) gid=1004(natasha) groups=1004(natasha),400000(adminuser)
3.新建一个名为harry的用户,并将adminuser作为其附属组
[root@localhost ~]# useradd harry -G adminuser
[root@localhost ~]# id harry
uid=1005(harry) gid=1005(harry) groups=1005(harry),400000(adminuser)
4.新建一个名为sarah的用户,并将其shell设置为不可登录shell
[root@localhost ~]# useradd sarah -s /sbin/nologin
5.添加用户maomao 修改它的目录为/maomao 要求切换maomao时提示显示正常
[root@localhost ~]# usermod -d maomao maomao
[root@localhost ~]# su - maomao
su: warning: cannot change directory to maomao: