Answer the question
In order to leave comments, you need to log in
How to correctly allocate rights to a Linux folder and files?
Hello.
I actually had the following question, because I can't fully figure out the rights to linux.
For example, I have three files
~/file1
~/file2
~/file3
and also there are 3 users
user1
user2
user3
Let's say the owner of all files is user1. How to make
file1 able to edit user2 and user3
file2 could edit user2 and read user3
file3 could read user2 and couldn't read user3
Is this even possible or I don't understand linux philosophy?
Answer the question
In order to leave comments, you need to log in
https://wiki.debian.org/Permissions
https://wiki.archlinux.org/index.php/Access_Control...
So everything is simple:
add user2 to the user1 group.
And further down the list:
file1: -rw-rw-rw- (666)
file2: -rw-rw-r-- (664)
file3: -rw-r----- (640)
1. For each set of rights, you can create a separate group, include the necessary users in it and set the rights for the group on the desired file.
2. Don't forget that if the user has write access to the directory, they will be able to delete files they don't have access to, as this counts as working on the directory, not on the file. Can't add or read, but can delete.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question