I have successfully setup a samba v2 share on my x86 router, which is accessible by my Android, iOS, Linux and Windows devices.
share name "nas" pointing to /mnt/ext_hdd
User A - nobody, no password, read only
User B - smb_admin, with password, read + write
User A is working fine on all devices.
User B is also working fine, except for windows clients they cannot login. Even if I set a blank password for user B.
I hope you guys can help me out here, below my config.
I currently have a nas folder for nobody and a nas_a folder for smb_admin, to test things out.
Goal is to only have the nas folder with r/w access for smb_admin
On samba4 the below config should work in the way you want, by making the share readonly, but giving special write access via "write_list" to the admin.
The problem is only samba4 has the write_list UCI option to give smb_admin write access. If you use samba36, you can add the feature yourself just check my PR https://github.com/openwrt/packages/pull/8943
The alternative is, to ignore UCI and put your final share option directly into the template, including the write list = smb_admin option.
Ah you are right, did mix up something. Yes the sharename is defined via option name 'nas_a'.
If you want to put the option directly into the smb.conf.template, you need to use the samba options. Just check the smb.conf for the dynamically created share section and copy only this into your template, including any extra option thats not supported by UCI.
[nas]
path = /mnt/ext_hdd
valid users = nobody
write list = smb_admin
browseable = yes
read only = yes
guest ok = no
create mask = 0700
directory mask = 0700
This is what I currently have in my samba conf template.
User "nobody" can login fine (with an empty password) to my server "\\192.168.1.1\" and even directly to my shared folder "\\192.168.1.1\nas\" all while only having read access, which is exactly how I would like it to be.
User "smb_admin" can login (only with username + password) to my server "\\192.168.1.1\" but cannot access my shared folder "\\192.168.1.1\nas\".
When trying to access the share "nas" it asks me again for my login credentials and then tells me "Access denied" with a new login prompt.
Try remove valid users or add smb_admin to it. You can also run testparm via shell and see if anything sticks out, its the samba tool that checks your config for error's.