Samba- Access is Denied from Windows 10

If you want to enable guest mode in Windows 10/11 >24H2
save the following in the bat file and run with admin privileges

Echo Guest Access in SMB2
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" /v "AllowInsecureGuestAuth" /t REG_DWORD /d 0x1 /f
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" /v "RequireSecuritySignature" /t REG_DWORD /d 0x0 /f

or to add a user to OpenWRT & Samba via SSH
Replace User with User Name
Replace PassWord with Pass Word

opkg update 
opkg install shadow-useradd
opkg install samba4-utils
useradd User
echo -e "PassWord\nPassWord" | (passwd User)
echo -e "PassWord\nPassWord" | (smbpasswd -a User)

or to add a user to OpenWrt & KSMDB via SSH
Replace User with User Name
Replace PassWord with Pass Word

opkg update 
opkg install ksmbd-utils
echo -e "PassWord\nPassWord" | (ksmbd.adduser -a User)

maybe easier to just use the following commands directly for user account
and follow prompts
do remember to add the username in the NetworkShares>Shared Directories>ShaeName>Allowed users

useradd User
passwd User
smbpasswd -a User
or
ksmbd.adduser -a User

for the router to show up under your network shares in windows

opkg update
opkg install wsdd2

Thank you so much for this. Do you know if there is any log to tail or view for samba connect attempts? Seems like working blind without it. I got Wireshark if that helps

Thank you. I used another guide as this one does not include setting up the drivers and file system. I will be giving it another go today. I really want to get this going as I purchased a USB drive.

Thanks, I had high hopes adding the user would help. Well at least no more Access is Denied error
Screen Shot 10-30-24 at 10.49 AM

Again, thank you! It is working. Not sure what got it going for sure but may have had something to do with with mount point in Luci. I made it Custom and put in /USB and got in from windows.

Thank you
Steve

Well thanks to the help from user Lucky1 I can now see the share and the drive in Windows. While I can add small files like a photo I cannot put a movie or large file. Using Google I can see others with the issue about root issue not allowing large files but not helping my situation, Here is the error

Screen Shot 10-30-24 at 11.47 AM

Off-topic to chat header

The best way I have found to set up a shared HDD drive via OpenWrt
is you needed to format the HDD as EXT3 or EXT4
FAT32 will work, but slower, a little more problematic
but if you want to remove and use on pc as well, I get it

Samba is much better then KSMDB
KSMDB just stops and falls over with 2 or more pc's trying to access it at once

Samba is the better with OpenWrt problems just don't show up
only that your router needs the flash space to load it

Ext root can work, but that's a mission to set up and maintain
and drive is locked to router

do check ram usage as well, your router may not have enough to do this and other things

This is simply saying you are out of space
maybe you have mounted a piece of flash to your share and not he HDD
Or is incorrectly configured

Not sure what that means but I have moved it off my sandbox router to the house rtr and nothing is going well at all. Will put back on sandbox for more testing
thank you

1 Like

I should mention (as is discussed with the filesystems and drivers section in the guide I linked) that while ext4 is great there is no issue in Linux/OpenWrt with NTFS or exFAT. I get 100-115 MB/s read/write on my 7 year old WRT32X with both of them, and similar speeds on my newer GL-MT6000. Both almost saturate gigabit LAN with a USB3 drive. Filesystems have come a very long way in Linux from what they were 10 years ago.

But I do agree Samba is mostly better, it's a bit larger package but doesn't matter when devices have so much space these days. I would hope OpenWrt team would update the Samba pkg to 4.21 as it's quite good.

1 Like

I did forget about NTFS
but for new players, don't use kmod-fs-ntfs
use ntfs-3g

tho I do see a kmod-fs-ntfs3 but never tried this

Yes for sure, ntfs-3g is well documented on those wiki links. I think ntfs3 being kernel space is promising but when I tested it initially it performance wasn't quite as good, haven't retried it since. edit: just googled it some are saying ntfs3 is definitely faster now good to know.

1 Like

Most of the people who try to use Samba or KSMBD are trying to set up a rudimentary NAS drive with a singular HDD attached to a USB SATA adapter.
Getting Samba to work correctly is a HUGE issue on most routers commonly available at affordable prices. These routers have a USB port. However, the RAM and Flash storage is VERY low.
Samba can work on routers that have at least 256MB Flash and 256MB RAM. Anything below is a challenge as RAM is easily overwhelmed and there's no space to run SAMBA.
Such kludgy NAS needs the router's internal RAM to do the heavy lifting, and it often fails to handle large files.
The alternative is KSMBD. It is a lightweight Kernel-based network storage platform. However, it is not robust and struggles with speed and multiple users.
No wonder there are SO MANY NAS solutions in the market today. However, their cost is a little high for the sole service they are going to be using.