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.