I want to allow access to 2 users on one directory. I am trying since days but unable to do so! Let me make it simple for you guys to understand by giving a simple example. But first, Let me tell you that the user named admin should be able to access both the directories.
Consider two Directories:
/var/www/directory1/var/www/directory2
and two users:
user1user2
I want user1 to access only the directory directory1, user2 to access the directory directory2 and admin to access both the directories!
I tried giving ownership to respective directories to the users and the group named admin-group to let admin access both the directories. That didn't work well. I also tried giving write access to the group but failed.
Is it possible to do what I want? If possible, How can I?
sudoto run as root, you don't need to grant it any special access rights, as they could just take them themselves when needed. However, your approach you described sounds about right if you don't want to rely onsudopowers. What exactly failed? Did you forget to makeadminuser a member ofadmin-group? What file system are those directories on? Note that the standard Linux permissions only work on file systems like ext4, but not on FAT or NTFS. – Byte Commander Apr 14 '17 at 23:18adminuser has power to work on automation like updating software.sudois not used and don't want to use as it's unstable for automation. – Adarsh Sojitra Apr 14 '17 at 23:21dir1groupwithdir1user1anddir2withdir2user1and makeadmin:dir1owner of the group! But I don't think it's the standard way. But by doing this I will be able to allow more users to access the directory too! – Adarsh Sojitra Apr 14 '17 at 23:27