A
A
Artyom2015-07-24 15:56:20
linux
Artyom, 2015-07-24 15:56:20

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

3 answer(s)
S
sim3x, 2015-07-24
@artem328

https://wiki.debian.org/Permissions
https://wiki.archlinux.org/index.php/Access_Control...

D
D', 2015-07-24
@Denormalization

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)

S
Saboteur, 2015-07-24
@saboteur_kiev

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 question

Ask a Question

731 491 924 answers to any question