The setfaclgetfacl method for setting permissions for multiple groups in a file in linux -- managing configuration

Source: Internet
Author: User
**************************************** *****************************

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

// Information of the file to be set:

V0id6 @ v0id6-eof ~ $ Ls testacl-la
-Rw-r -- + 1 v0id6 v0id6 9 March 2 14:21 testacl

// Obtain the object access control list (this is the value before setfacl is not used)
V0id6 @ v0id6-eof ~ $ Getfacl testacl
# File: testacl
# Owner: v0id6
# Group: v0id6
User: rw-
Group: r --
Other: r --

// Configure the read and write permissions for multiple groups
V0id6 @ v0id6-eof ~ $ Setfacl-m g: v0id6: rw, g: yygydjtest: rw testacl
V0id6 @ v0id6-eof ~ $ Getfacl testacl
# File: testacl
# Owner: v0id6
# Group: v0id6
User: rw-
Group: r --
Group: v0id6: rw-
Group: yygydjtest: rw-
Mask: rw-
Other: r --

// Delete the group control permission
V0id6 @ v0id6-eof ~ $ Setfacl-x g: yygydjtest testacl
V0id6 @ v0id6-eof ~ $ Getfacl testacl
# File: testacl
# Owner: v0id6
# Group: v0id6
User: rw-
Group: r --
Group: v0id6: rw-
Mask: rw-
Other: r --

NOTE: to obtain and configure the group name, use cat/etc/group to view the existing group or add it using groupadd.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.