Issues when setting two samba users to the same folder

Hello,

I attach an external usb drive to my router and mount it to /mnt/documents. I have created two samba users (samba1 and samba2) to access that folder. Samba1 is supposed to have full write access, samba2 is supposed to have read-only access.

I was not successful setting this up via LUCI, it didn't like that both samba users have the same mount point (if I remember correctly).

So, I modified

/etc/samba/smb.conf

like this:

[media]
path = /mnt/documents
valid users = samba1, samba2
write list = samba1
create mask = 0666
directory mask = 0777
read only = yes
guest ok = yes

Which gives write access to samba1 while samba2 is read-only.

My question is: Is there another way to do this besides directly editing the samba conf file? Because whenever I do an update, that conf file is reset and I have to ssh to the router and do the modifications by hand.

Any suggestion would be appreciated.

Thats like cd-rom, write list is ignored.

Hi,

Thanks for replying.

I am not sure, I understand what you are trying to say here.

read only = yes

sets samba to read only for all users, while

write list = samba1

excludes that user from the read-only rule and allows them to have write access. So, write list is essential here for samba1 user. It is not ignored.

Either way, that doesn't help with my initial question. I'd really like to know how to make those chances permanent and not losing them during updates.

From the horses mouth man 5 smb.conf

read only (S)

An inverted synonym is writeable.

If this parameter is yes, then users of a service may not create or modify files in the service's directory.

Note that a printable service (printable = yes) will ALWAYS allow writing to the directory (user privileges permitting), but only via spooling operations.

Default: read only = yes

Also in modern windows you dont need guest ok style access, as it defaults to ntlm v(alot) to start.