tencent cloud

Feedback

User Permission Management

Last updated: 2024-01-22 22:15:48
    This document describes how to set the access permissions of users and user groups based on the POSIX syntax in a file system, which can be Standard (NFS), High-Performance (NFS), Standard Turbo, or High-Performance Turbo.

    Prerequisites

    You have mounted the file system over the Turbo or NFSv3 protocol as instructed in Using CFS Turbo on Linux Clients or Using CFS File Systems on Linux Clients.

    Command description

    Command
    Description
    getfacl <filename>
    View the current ACL of the file.
    setfacl -m g:cfsgroup:w <filename>
    Set the write permission for the cfsgroup user group.
    setfacl -m u:cfsuser:w <filename>
    Set the write permission for the cfsuser user.
    setfacl -x g:cfsgroup <filename>
    Delete the permission of the players user group.
    getfacl file1 | setfacl --set-file=- file2
    Copy the ACL of file1 to file2.
    setfacl -b file1
    Delete all extended ACL rules and retain basic ACL rules (owner, group, and others).
    setfacl -k file1
    Delete all default rules from file1.
    setfacl -R -m g:cfsgroup:rw dir
    Grant the cfsgroup user group the permission to read/write files and directories in the dir directory tree.
    setfacl -d -m g:cfsgroup:rw dir
    Grant the cfsgroup user group the permission to read/write newly created files and directories in the dir directory tree.

    Example

    sudo useradd cfsuser # Create the `cfsuser` user
    sudo useradd otheruser # Create the `otheruser` user
    sudo groupadd cfsgroup # Create the `cfsgroup` user group
    sudo usermod -g cfsgroup cfsuser # Allocate `cfsuser` to `cfsgroup`
    sudo touch file1 # Create a file named `file1`
    sudo setfacl -m g:cfsgroup:r-x file1 # Grant the `cfsgroup` user group the permission to read and execute `file1`
    sudo setfacl -m u:otheruser:rwx file1 # Grant the `otheruser` user the permission to read/write and execute `file1`
    
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support