I've been bashing my head against this for HOURS searching every thread on every site I can find, but so far nothing that has worked for other people has worked for me.
I am trying to setup up a network share on a USB drive with Samba4 on my router. I followed the instructions on this page https://openwrt.org/docs/guide-user/services/nas/cifs.server, step by step, very carefully, twice. When I attempt to open the file share from my Win10 PC or my Android phone, I put in the username and password that I added to passwd and smbpasswd (I checked many times that the name and password are correct, and I am not trying to login as root because I understand that this is prohibited by default) I receive a message saying "access denied".
I've tried toggling Force Root, Guest Ok, and Inherit Owner in different combinations to no effect. I changed dir_mask from "0777" to "777" per a recommendation online, but again no effect.
Some threads suggested making various edits to smb.conf, but any changes I try to make there have no effect and get overwritten automatically when I start/restart the Samba service. I also tried using different formats on the share partition (NTFS and Ext4), changing ownership of the share directory from root to wyntrheart, and doing a complete reinstall of Samba, wiping all the config files, and I even tried enabling login as root in smb.conf. Nothing worked, still "Access Denied".
I can post whatever command outputs or config files you need to see, I can change settings with luci or ssh, whatever I need to do to make this damn thing work. I am tired. Thank you in advance to anyone who tries to help me solve this headache
root@wyntr-router-0:~# ls -ld /mnt /mnt/sda2 /mnt/sda2/share
drwxr-xr-x 1 root root 4096 Mar 15 10:53 /mnt
drwxr-xr-x 3 root root 4096 Mar 15 10:05 /mnt/sda2
drwxrwxrwx 2 wyntrhea root 4096 Mar 15 10:05 /mnt/sda2/share
I've tried accessing by \\(IP address), by \\wyntr-router-0, and both with \wyntr-router-smb0 appended, no luck. The first two will show me the file share in explorer.exe, but all four get "Access denied" on password entry
Did you create the user wintrhea?
If you ssh to the router, can you log in with wyntrhea and it's password?
If you can login, do you have access to the "shared area"?
can you ping lan on your router (from within the router), and get a reply/IP back?
it doesn't work for me, if it's the same for you, try putting the routers LAN IP here.
check if samba is listening, using netstat -l -n -p.
No, the user I created is "wyntrheart", I'm assuming ls is just not able to fit the whole name here because it shows correctly as "wyntrheart" in passwd and smbpasswd. I can't ssh with that username, which I'm assuming is because I didn't set a terminal for the user
I don't understand what you mean by "ping lan". Like, should I type "ping lan" as a command (doesn't work)? I can ping the routers own IP if that's what you mean, and it works normally.
I had to set this up a few years ago for an office full of windows machinesđŸ˜±
I recall that it would only work if I could ssh as the user first. This might not be true I guess but is what I did.
I created a group for SMB users and gave the group rights keeping root as the owner.. Then added any users to the group.
I had no problems after.
How do I create a group and 'give them rights'? In particular what kind of "rights" does the group need to have? (I can look up how to add a group, but I need more specific instructions about what I need to do with the group)
Use chown to set owner and group for the share directory.
Then use chmod to set the access rights.
I'm not saying all this is necessary but from memory it worked for me. The advantage being you can be very flexible with multiple users eg read-only or read write depending on user etc.