How do I define a samba share so that every user can only see its own home?

13,151

I think you should change valid users = ashley joe %S to only valid users = %S. In your example, ashley, joe and %S [the name of the share] is always valid, so ashley and joe can reach all homes, any other (if there are) users should only see their own in the example you gave.

Share:
13,151

Related videos on Youtube

Patryk
Author by

Patryk

Software Engineer C++/Go/shell/python coder Linux enthusiast Github profiles: https://github.com/pmalek https://github.com/pmalekn

Updated on September 18, 2022

Comments

  • Patryk
    Patryk over 1 year

    I would like to make every user's home directory from Debian machine to be available by its owner only (using Samba) but for now (with default Samba configuration) I can access other users /homes.

    Here is the [home] config part :

    [homes]
    comment = Home Directories
    browseable = no
    public = no
    read only = no
    create mask = 0700
    directory mask = 0700
    valid users = ashley joe %S
    

    By logging on ashley's account from Windows 7 machine I can browse joe's home. How should I configure this ?

  • Jontas
    Jontas about 12 years
    For others finding this via google %S is the name of the Current share's name, see oreilly.com/openbook/samba/book/appc_01.html#appc-88529 for a list of all varaibles