[Samba] Hide the files that doesn't have permission to access

James lingpanda101 at gmail.com
Wed Oct 14 16:11:40 UTC 2015


It sounds like you want to hide shares and not files? With windows you 
can hide a share from being browsed by doing the following.

[smb_shr1$]
         path = /mnt/LV002/share1
         read only = no
         create mode = 0777
         directory mode = 0777
         valid users = hai

Appending the $ removes the share from being browsed. They can access 
this share if they know the name however. You may still want 'browseable 
= no' for other OS's that don't support the $. This all assumes you're 
attempting to hide shares and not files.

On 10/14/2015 5:55 AM, Nguyen Xuan. Hai wrote:
> Hi all,
>
> I want to shows a user only the files that he/she has permission to 
> access.
> I configured smb.conf like that:
>
> [global]
>     workgroup = STORAGE
>     encrypt passwords = yes
>     security = user
>     access based share enum = yes
>     hide unreadable = yes
>     hide unwriteable files = yes
>
> [smb_shr1]
>         path = /mnt/LV002/share1
>         read only = no
>         create mode = 0777
>         directory mode = 0777
>         public = yes
>         valid users = hai
> [smb_shr2]
>         path = /mnt/LV002/share2
>         writable = yes
>         create mode = 0777
>         directory mode = 0777
>         public = yes
>         valid users = test
>
> It is no effect. From windows 8 client, I accessed to samba server and 
> logged in by user "hai" but I still see two share folders (smb_shr1, 
> smb_shr2).
>
> Thanks!
>

-- 
-James




More information about the samba mailing list