Set the permissions of multiple groups on a file under linux (setfaclgetfacl) method - management

  
        

/********************************************** *********************** * Author : Samson * Date : 03/02/2014 * Test platform: * Linux ubuntu 3.2.0-58-generic- Pae * GNU bash, version 4.2.39 * **************************************** ***************************/

//Information about the file to be set:
v0id6@v0id6- Eof ~ $ ls testacl -la-rw-rw-r--+ 1 v0id6 v0id6 9 March 2 14:21 testacl//Get the access control list of the file (this is the value before the setfacl is used) v0id6@v0id6 -eof ~ $ getfacl testacl# file: testacl# owner: v0id6# group: v0id6user::rw-group::r--other::r--//Configure multiple groups to read and write permissions v0id6@v0id6-eof ~ $ setfacl -mg:v0id6:rw,g:yygydjtest:rw testaclv0id6@v0id6-eof ~ $ getfacl testacl# file: testacl# owner: v0id6# group: v0id6user::rw-group::r--group:v0id6: Rw-group:yygydjtest:rw-mask::rw-other::r--//Delete group control permission v0id6@v0id6-eof ~ $ setfacl -xg:yygydjtest testaclv0id6@v0id6-eof ~ $ getfacl testacl# file: testacl # owner: v0id6# group: v0id6user::rw-group::r--group:v0id6:rw-mask::rw-other::r--NOTE: Use cat /etc/for group name acquisition and configuration. Group view the currently existing group can also be added using groupadd

Copyright © Windows knowledge All Rights Reserved