2

OK so I understand this is probably a super newby question but I've been playing around with this and trying everything within my knowledge to get this sorted but just cannot figure it out.

Basically I'm wanting to create a file system on my local server to allow me and other people to access using samba but the permissions are killing me.

Basically I want the structure to be this:

Share files (accessible by everyone)

User 1 (rwx by only me)

-user 2 (rwx by me and user 2)

--user 3 (rwx by me, user 2 and user 3)

--user 4 (rwx by me, user 2 and user 4)

--user 5 (rwx by me, user 2 and user 5)

Folder hierarchy would be user 1 folder at the top, then user 2 would be a subfolder of that, and then users 3,4,5 would be subfolders of user 2.

So I think I understand the samba permissions being that I can just do 'valid users = user 1, user 2... Etc' but the actual Linux permissions are beyond me

0

You could do it with group permissions so that the higher level users (1 & 2) are in the lower level user's groups.

For every user there is a user group by that user's name, so set your users' group membership as so:

  • User 1 is a member of groups 1,2,3,4,5
  • User 2 is a member of groups 2,3,4,5
  • Users 3,4,5 are not members of any of the other groups.

Make sure there is universal execute access to the higher level directories so that all users can access the hierarchy. Syntax is

usermod -aG <groupname[,groupname]> <username>

 # usermod -aG 2,3,4,5 1
 # usermod -aG 3,4,5 2

and so on...

Your directory permissions should be 775, that is user and group have full access and world has only read and execute. If you don't want 4 and 5 to have access at all to 3's personal directory then you could make 3's permission 770

 # chmod 775 3

And so on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.