1

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?

Okrx
  • 111

1 Answers1

2

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.

Chris Davies
  • 116,213
  • 16
  • 160
  • 287