Linux command: Access control list for Facl file system

Source: Internet
Author: User

Facl Introduction to Commands:

Save additional access control permissions with file extensions

1 . Command format:

setfacl [option] [Perm]file

SETFACL: Set Facl access control permissions

Getfacl: View facl access control permissions

2 . Command function:

Use file extensions to save additional access control permissions, set file access control permissions

3 . Command parameters:

Setfacl

-M: Set FACL permissions

U:uid:perm set-m u:uid:perm File

G:gid:perm set-m g:gid:perm File

-X: Cancel the Set FACL permissions only need to specify the user and UID

U:uid Setfacl-x u:donggen/test/test1.sh

G:gid

If you set the default Facl permissions for a specific directory, so that the new file or directory in the directory by default has FACL permissions, only for the directory settings, with the following 2 commands, a new directory in this directory or file users have Facl permissions, one is to make A new directory or file in this directory has FACL permissions for a group.

Setfacl-m D:u:uid:perm

setfacl-m d:g:uid:perm  

4 . Command instance:

1. Set FACL permissions for a file

Setfacl-m u:donggen:rw/test/test1.sh Set User Donggen have read and write permissions for/test/test1.sh files

[Email protected] ~]# getfacl/test/test1.sh

Getfacl:removing leading '/' from absolute path names

# file:test/test1.sh

# Owner:root

# Group:root

User::rwx

Group::r-x

Other::r-x

[Email protected] ~]# setfacl-m u:donggen:rw/test/test1.sh

[Email protected] ~]# Getfacl

Usage:getfacl [-ACEESRLPTPNDVH] File ...

Try ' Getfacl--help ' for more information.

[Email protected] ~]# getfacl/test/test1.sh

Getfacl:removing leading '/' from absolute path names

# file:test/test1.sh

# Owner:root

# Group:root

User::rwx

user:donggen:rw-

Group::r-x

MASK::RWX *mask indicates that the SET FACL permission value should not exceed this value.

Other::r-x

Setfacl-m g:donggen:rw/test/test1.sh sets Facl permissions for the group.

2, cancel the set of Facl

Setfacl-x u:donggen/test/test1.sh

Setfacl-x g:donggen/test/test1.sh

* The order of permissions to access files is:

Ower->facl,user->group->facl,group->other

The first is to see the owner followed by the Facl set of user rights, and then see the group of rights closely followed

is the set Facl,group permission, finally see other permissions.



This article is from the "Learn Linux history" blog, please be sure to keep this source http://woyaoxuelinux.blog.51cto.com/5663865/1865640

Linux command: Access control list for Facl file system

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.