In a previous article, we showed you how to create a shared directory in Linux. Here, we will describe how to give read/write access to a user on a specific directory in Linux.
There are two possible methods of doing this: the first is using ACLs (Access Control Lists) and the second is creating user groups to manage file permissions, as explained below.
For the purpose of this tutorial, we will use following setup.
Make sure all commands are executed as root user or use the the sudo command with equivalent privileges.
Let’s start by creating the directory called
reports
using the mkdir command:Using ACL to Give Read/Write Access to User on Directory
Important: To use this method, ensure that your Linux filesystem type (such as Ext3 and Ext4, NTFS, BTRFS) support ACLs.
1. First, check the current file system type on your system, and also whether the kernel supports ACL as follows:
From the screenshot below, the filesystem type is Ext4 and the kernel supports POSIX ACLs as indicated by the CONFIG_EXT4_FS_POSIX_ACL=y option.
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
► Read more: http://adf.ly/1n5ZF3
▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
No comments:
Post a Comment