Can't edit or create files with Samba Server on Windows

Newbie here.
I have no idea how to set up Samba for editing and creating files on Windows. This is my smb.conf file.


        workgroup = WORKGROUP
        server string = %h server
        dns proxy = no
        log file = /var/log/samba/log.%m
        max log size = 1000
        syslog only = no
        syslog = 0

        panic action = /usr/share/samba/panic-action %d

        security = user
        encrypt passwords = true
        passdb backend = tdbsam
        obey pam restrictions = yes
        unix password sync = yes

        passwd program = /usr/bin/passwd %u
        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully>        pam password change = yes
        map to guest = bad user

        load printers = no
        printcap name = /dev/null
        disable spoolss = yes
        comment = DietPi Share
        path = /mnt/dietpi_userdata
        browseable = yes
        create mask = 0777
        directory mask = 0777
        validusers = dietpi
        writeable = Yes

Doesn’t ask for user and password (maybe I have to turn browseable off?)

What do you mean by this? You already mounted the share from DietPi on your windows system? What exactly you enter within windows explorer?

“\\ip\dietpi” in Windows Explorer

and what is your error message?

On Windows when I try to create a new file:
“Destination Folder Access Denied
You need permission to perform this action”

you already get the error message while trying to enter the basic folder or during navigation inside the share?

During neither. Just everytime i try to modify or create something.
I can view files just fine.

can you give an example of the files your like to modify?

Can you share content from operating system directly

ls -la /mnt/dietpi_userdata/path-to-your-folder

What does that command do?
For example, I’d like to modify the favicon of my cuberite Minecraft server.
The path is “\\\dietpi\cuberite\favicon.png” or “/mnt/dietpi_userdata/cuberite/favicon.png”.

ls -la /mnt/dietpi_userdata/cuberite/

Done. What did that do?

it don’t do anything. It will show the content of the folder only. And it would be helpful to share with us.

root@DietPi:~# ls -la /mnt/dietpi_userdata/cuberite/
total 8764
drwxr-xr-x 12 cuberite cuberite    4096 Mar 19 20:08 .
drwxrwxr-x 10 dietpi   dietpi      4096 Mar 19 16:59 ..
-rw-r--r--  1 cuberite cuberite     389 Mar  8 08:43 BACKERS
-rw-r--r--  1 cuberite cuberite    1644 Mar  8 08:43 CONTRIBUTORS
-rwxr-xr-x  1 cuberite cuberite 8681840 Mar  8 08:52 Cuberite
-rw-r--r--  1 cuberite cuberite   11641 Mar  8 08:43 LICENSE
-rw-r--r--  1 cuberite cuberite   12288 Mar 19 16:44 MojangAPI.sqlite
drwxr-xr-x 11 cuberite cuberite    4096 Mar  8 08:43 Plugins
drwxr-xr-x  5 cuberite cuberite    4096 Mar  8 08:43 Prefabs
drwxr-xr-x  5 cuberite cuberite    4096 Mar  8 08:43 Protocol
-rw-r--r--  1 cuberite cuberite     692 Mar  8 08:43 README.txt
-rw-r--r--  1 cuberite cuberite   32768 Mar 19 18:24 Ranks.sqlite
drwxr-xr-x  2 cuberite cuberite    4096 Mar  8 08:43 ThirdPartyLicenses
-rw-r--r--  1 cuberite cuberite   12288 Mar 19 15:44 banlist.sqlite
-rw-r--r--  1 cuberite cuberite    2748 Mar  8 08:43 brewing.txt
-rw-r--r--  1 cuberite cuberite     126 Mar  8 08:52 buildinfo.txt
-rw-r--r--  1 cuberite cuberite   61733 Mar  8 08:43 crafting.txt
-rw-r--r--  1 cuberite cuberite    2233 Mar  8 08:43 favicon.png
-rw-r--r--  1 cuberite cuberite    8484 Mar  8 08:43 furnace.txt
-rw-r--r--  1 cuberite cuberite     872 Mar 19 15:44 itemblacklist
-rw-r--r--  1 cuberite cuberite   26108 Mar  8 08:43 items.ini
drwxr-xr-x  2 cuberite cuberite    4096 Mar 19 16:46 logs
-rw-r--r--  1 cuberite cuberite    3010 Mar  8 08:43 monsters.ini
-rw-r--r--  1 cuberite cuberite      92 Mar 19 15:44 motd.txt
drwxr-xr-x  3 cuberite cuberite    4096 Mar 19 15:48 players
-rw-r--r--  1 cuberite cuberite    1174 Mar 19 16:46 settings.ini
drwxr-xr-x  3 cuberite cuberite    4096 Mar  8 08:43 webadmin
-rw-------  1 cuberite cuberite      71 Mar 19 16:46 webadmin.ini
-rw-r--r--  1 cuberite cuberite   16384 Mar 19 15:44 whitelist.sqlite
drwxr-xr-x  5 cuberite cuberite    4096 Mar 19 15:48 world
drwxr-xr-x  4 cuberite cuberite    4096 Mar 19 15:44 world_nether
drwxr-xr-x  4 cuberite cuberite    4096 Mar 19 15:44 world_the_end

no idea why some appear in red in here.

ok I adjusted your post to remove the red color.

Are you familiar with Linux user permissions? If not, you might have a look to following blog File Permissions in Linux / Unix: How to Read, Write & Change? It will explain how permission ad access right are working on Linux systems.

All files and folders are owned by user/group cuberite. Means this user is the only one who could write to these files. Noone else could do that. On a default DietPi system, you login as user dietpi to the Samba share. That’s why you don’t have access to these files and you get permission denied.

Theoretically you could modify Samba configuration in a way to allow root user access.

How could i add user “dietpi” to have read/write permissions of the “cuberite” folder? I am a Linux and Samba newbie.

Better to use root user to login to Samba share. That would be the simplest solution. For user dietpi you would need to change permission for all files and folders.

Therefore add user root to your smb.conf as allowed user and check if this is already working.

I added root as a valid user, but i can’t log in. I am using the same root password I use when i ssh through cmd using “ssh root@192.168.0.x” but i can’t login to the samba share.

Have a look to our online docs how to chapter add/change user File Servers Options - Docs