Linux based SMB share: can access only using owner account from Windows

10,604

You've got valid users = @mac, so any member of this group can access the share as far as SAMBA is concerned. But you've got write list = peter so only peter can have a chance of writing to the share.

However, you also need to overlay UNIX file permissions. You have got drwxrw-r-x 2 test_reader mac, which allows test_reader sufficient access. It does not give any useful access to group mac because you're missing the necessary x bit in the group directory permission.

In general, if you're using SAMBA to manage access rights I would suggest that you set the filesystem permissions to be rwxrwxrwx (777). There are exceptions to this, of course, such as when you have users logging in to the server. But for a dedicated fileserver it's a good starting point.

Share:
10,604

Related videos on Youtube

Okrx
Author by

Okrx

Updated on September 18, 2022

Comments

  • Okrx
    Okrx over 1 year

    In Windows when I connect using test_reader account I can access with no problems. However when I use peter account it gives me Access Denied.

    I did some testing and if I change share folder ownership to peter I can access using peter account and then there's no acccess for test_reader. So only a folder owner can access the share.

    smb.conf:

    [share]
            comment = Venice
            path = /media/test_folder/share
            read only = yes
            create mask = 0650
            directory mask = 0760
            browsable = yes
            valid users = @mac
            write list = peter
    

    mac memebrs:

    mac:x:502:test_reader,peter
    

    Folder permissions:

    drwxrw-r-x 2 test_reader mac   2048 Jun  9 18:23 share
    

    I have set smbpasswd for each accounts.

    Why I cannot access the share using peter account that belongs to the same group as test_reader?

    • jesse_b
      jesse_b almost 6 years
      I believe they may need execute permissions to open the directory. Which owner has but group does not.
    • Okrx
      Okrx almost 6 years
      @Jesse_b you're right, I was missing the x permission