0

My Linux system has two users, and I configured samba on it, so some shared directories are accessible by both uses, and some are accessible by one of them.

The problem is when I access the computer from Windows clients and authenticate using the second user (with less permission), the folders which are not accessible are shown (although they are not browsable), how can I hide these folders from this user?

Here is a part of /etc/samba/smb.conf file:

[anonymous]
    path = /repo/samba/anonymous
    writeable = yes
    browseable = yes
    valid users = user1, user2

[archive]
    path = /repo/samba/archive
    writeable = no
    browseable = yes
    valid users = user1, user2

[user1]
    path = /repo/samba/user1
    writeable = yes
    browseable = yes
    valid users = user1

[user1-ro]
    path = /repo/samba/user1-ro
    writeable = no
    browseable = yes
    valid users = user1

When user2 tries to access the server, they see user1 and user1-ro folders too, and I want to hide these two for them.

I shall mention that the linux system runs Ubuntu-MATE 16.04.

0

Add:

hide unreadable = yes

to the share definitions in your config.

This is called "access-based enumeration" in SMB vernacular.

0

I'm not sure why but @techraf answer didn't work (although according to docs it should), but I found another solution and it worked. I've added

access based share enum = true

to /etc/samba/smb.conf file.

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.