Help with samba and windows 10

I have samba setup where I can access it, however I can't write to it. I'm not sure where to start troubleshooting.

root@LEDE:~# cat /etc/config/samba

config samba
        option name 'Lede'
        option workgroup 'WORKGROUP'
        option description 'Lede'
        option homes '1'

config sambashare
        option path '/mnt/sda2'
        option read_only 'no'
        option guest_ok 'yes'
        option name 'lede'
        option create_mask '0660'
        option dir_mask '0771'

have you verified the /mnt/sda2 permissions, what is the message when tring to write?
try:

chmod 777 /mnt/sda2

and write a file on that root folder using your windows.

1 Like

how do I verify permissions? The error I get is You need permissions to perform this action.

Running this fixed it. Is there a guide somewhere I can read up about it? I'm not sure if I missed it.
chmod 777 /mnt/sda2

Your samba users need write access to the directory they are writing to. Giving full access to everyone (777 pretty much means "everyone, go wild") is the easiest way to achieve that.

It's not super secure, especially if the system is shared between users, but it should be sufficient if you just quickly want to share a drive. The more correct (but admittedly much more cumbersome) way would be to add individual users (named after your samba users) and organize them in a user group, then adjust the directory permissions so only the group has access.

You can verify using:

ls -l /mnt/sda2

you will see at the left "r", "w" and "x" indicating "user", "group", "all" levels, first "d" indicates directory. You should google "unix permissions" to know more about, this it is a standard in all unix based systems.

to get full permissions across all mounted volume sub-directories (sub-folders in windows) you should run:

chmod -R 777 /mnt/sda2

-R stands for "recursive". "777" means "rwxrwxrwx", usually defaults for directories is 755 and files 644.

If you need help securing your samba, with user-password authentication let us know.

So far all users in your network will be able to read-write (also delete) without any user login, if this is for your home in a controlled enviroment and your data it is not important (music, movies, etc) you probably will not need this.

Thanks if command "chmod 777 / mnt / sda1" I solve writing to my disk. Thank you! :sonriendo:

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.