配置Samba服務--ACL分配權限

假設要共享一個文件夾newfile及它下面的兩個子目錄newfile1,newfile2.要求用戶aa管理所有目錄,bb管理newfile1目錄,cc管理newfile2目錄,

用戶aa擁有所有權限,

而bb只管理目錄newfile1,還有就是可讀目錄newfile1,但不可以寫,

用戶cc只管理目錄newfile2,還有就是可讀目錄newfile1,但不可以寫,

解析:把aa和bb分成一個組gg2,把aa和cc分成組gg1,


[root@ertou /]# setfacl -m u:aa:rwx,g:gg1:rwx,o::- newfile

[root@ertou /]# setfacl -m u:aa:rwx,g:gg2:rwx,o::- newfile

[root@ertou newfile]# setfacl -m u:bb:rwx,g:gg2:rx,o:rx newfile1

[root@ertou newfile]# setfacl -m u:cc:rwx,g:gg1:rx,o::rx newfile2

[root@ertou samba]# smbpasswd -a aa(bb和cc)
New SMB password:
Retype new SMB password:
Added user aa.

[root@ertou /]# usermod -G gg1,gg2 aa
[root@ertou /]# groups aa
aa : aa gg1 gg2

[root@ertou /]# usermod -g gg2 bb
[root@ertou /]# usermod -g gg1 cc

預設型ACL :就是把權限都先分配出來

[root@ertou newfile]#setfacl -m d:u:cc:rwx,d:g:gg1:rwx,d:o:rx newfile/newfile2

[root@ertou newfile]# setfacl -m d:u:bb:rwx,d:g:gg2:rwx,d:o:rx newfile1
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章