
##新建用户组shengchan,caiwu,jishu
[root@localhost Desktop]# groupadd shengchan
[root@localhost Desktop]# groupadd caiwu
[root@localhost Desktop]# groupadd jishu
##(1)adminsc的初始组为shengchan;
(2)adminjs的初始组为jishu;admincw的初始组为caiwu;
(3)tom时shengchan的附加用户;herry是caiwu的附加用户;
(4)leo是技术的附加用户;新建admin用户,此用户不属于以上三个用户
[root@localhost Desktop]# useradd -g shengchan adminsc
[root@localhost Desktop]# useradd -g caiwu admincw
[root@localhost Desktop]# useradd -g jishu adminjs
[root@localhost Desktop]# useradd -G shengchan tom
[root@localhost Desktop]# useradd -G caiwu harry
[r

本文通过实例展示了如何在Linux中创建用户组和用户,以及如何设置文件目录权限,确保不同部门的用户只能访问相应的存储目录。admin用户作为老板,拥有在所有目录中创建和删除文件的权限。
最低0.47元/天 解锁文章
2182

被折叠的 条评论
为什么被折叠?



