How to set permissions for multiple groups on a file under Linux: Managing Configuration

Source: Internet
Author: User
Tags linux

Information for the file to be set:

v0id6@v0id6-eof ~ $ ls Testacl-la

-rw-rw-r--+ 1 v0id6 v0id6 9 March 2 14:21 testacl

Gets the access control list for the file (this is the value before the SETFACL setting is used)

v0id6@v0id6-eof ~ $ getfacl Testacl

# File:testacl

# OWNER:V0ID6

# GROUP:V0ID6

user::rw-

group::r--

other::r--

Configure permissions for multiple groups to read and write

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--

Remove Group Control permissions

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: For the acquisition and configuration of group names use Cat/etc/group to view existing groupings or use Groupadd to add them

This column more highlights: http://www.bianceng.cn/OS/Linux/

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.