Samba: Restrict access to certain sub-directory [solved]


lsaranto

Recommended Posts

I want to restrict access from a user to certain sub-directories in a share.

My share is called "share1" and in that share I have directories labelled dir1, dir2, dir3. I have added users called "user1" and "user2" to Unraid. "user1" and "user2" are also Win10 usernames.

I want everyone including "user2" to have access to "share1", but only "user1" should have access to dir3.

I tried to google it and I tried setfacl, but it's not working.
 

Edited by lsaranto
Link to comment
  • 3 months later...
4 hours ago, trurl said:

Why not just use user shares the way they are intended to be used? 

 

If you need different access for different files put them in different user shares. 

 

In my case, I needed to limit access to a directory that is a few levels down from the share top. Yes I could have moved it to its own share, but that is not its logical place.

 

I tried to use ACL but didn't have enough skillz. What I ended up doing, was that I made my user the owner of the directory with +rwx rights, I gave +w rights to group as a certain program needs to be able to write to that directory, and -rwx to other. This isn't perfect. I think, technically, the blocked user is able to write and delete files from the directory. But in my case it's enough to keep out family members who have never seen Linux.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.