0

I am configuring a samba server for file sharing. I was wondering if there is a configuration setting to map different file or directory masks to different users.

I am attempting to allow admin users to have full access to a share while restricting guest users from listing directory contents.

Ive looked through the smb.conf man page and found nothing helpful.

Currently my samba share config looks like this:

[Public]
   Comment = Pi public share
   Path = /Samba/Public
   Browseable = yes
   Writeable = yes
   create mask = 0666
   directory mask = 1337
   Guest ok = yes

This config works perfectly if a guest were to create a new directory but if an admin tries the same he is restricted in this new directory.

I was wondering if there is a way solve this problem in samba, or if necessary, with a filesystem hack or pre/postrun script.

1 Answers1

0

For anybody stumbling across my post in the future I was able to solve this problem by creating 2 samba shares, both mapped to the same location. One share allowing guests. The setup works perfectly for my situation. My configurations look like this:

[Public]
   Comment = Public share for guests
   Path = /Samba/Public
   Browseable = yes
   Writeable = yes
   create mask = 0666
   directory mask = 1337
   Guest ok = yes
   Guest only = yes

[AdminPublic]
   Comment = Public share for admins
   Path = /Samba/Public
   Browsable = no
   Writeable = yes
   create mask = 0744
   directory mask = 1733
   Guest ok = no