How to use the access control list to limit user permissions under Linux

  
                

The access control list (ACL) under Linux is mainly used to control the permissions of users. Different users can have different permissions on the same file. How do you do this? The following small series teaches you how to set the access control list (ACL) under Linux to control user permissions.

Working with Liunx with permissions, working is an easy task. It can define any user, group and other permissions. This work is great whether it's on a desktop computer or a virtual Linux instance that doesn't have many users, or when users don't want to share files between them. However, if you are in a large organization and you are running NFS or Samba services to different users, then you will need to be flexible in selecting and setting up a lot of complex configurations and permissions to meet the different needs of your organization. Permissions

Linux (and other Unix and other POSIX compatible operating systems) have what is called an access control list (ACL) control method, which is generally beyond the paradigm of a rights assignment. For example, by default you need to confirm 3 permission groups: owner, group, and other. With ACL, you can add permissions to other users or groups, not just simple <;other” or groups that do not exist. The specified users A, B, and C can be allowed to have write access instead of having their entire group have write access.

ACL supports a variety of Linux file systems, including ext2, ext3, ext4, XFS, Btfrs, and so on. If you are not sure if your file system supports ACLs, please refer to the documentation.

Making ACLs Work in File System

First, we need to install tools to manage ACLs.

Ubuntu/Debian:

$ sudo apt-get install acl

CentOS/Fedora/RHEL:

# yum -y install acl< Br>

Archlinux:

# pacman -S acl

For demonstration purposes, I will use the ubuntu server version, other versions are similar.

After the ACL is installed, you need to activate the ACL function of our disk partition so that we can use it.

First, we check if the ACL function is turned on.

$ mount

You'll notice that my root partition ACL property has been opened. In case you don't have it turned on, you need to edit the /etc/fstab file and add the acl flag before the option to open the ACL partition.

Now we need to remount the partition (I like to complete restart, because I do not want to lose data), if you open the ACL on other partitions, you must also re-mount it.

$ sudo mount /-o remount

Good job! Now that we have opened the ACL in our system, let's start working with it.
Previous123Next page Total 3 pages

Copyright © Windows knowledge All Rights Reserved