Home > Enterprise >  Linux: Allow only 2 users (out of 3) to access specific folders
Linux: Allow only 2 users (out of 3) to access specific folders

Time:11-06

I currently have 3 users in a linux maching: user1, user2, root The folder /root/test can currently be accessed by user root only. Is it possible that this folder can be accessed by user1 also, but not user2 ?

user1 belongs to group user1. user2 belongs to group user2.

Thank you, Zvika

CodePudding user response:

You can change ownership of that folder to user1 by:

chown user1 /root/test

It could be also resolved by more complex solution like ACL which allows you to manage file permissions more flexible

setfacl -m u:user1:rwx /root/test
  • Related