# Can't write to samba share on Windows 11 despite changing the samba config

**URL:** <https://dietpi.com/forum/t/cant-write-to-samba-share-on-windows-11-despite-changing-the-samba-config/17035>\
**Category:** Troubleshooting\
**Created:** [8 June 2023 07:52 UTC](https://dietpi.com/forum/t/cant-write-to-samba-share-on-windows-11-despite-changing-the-samba-config/17035 "2023-06-08T07:52:45Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![kelliegator](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/k/e99b99/32.png) [@kelliegator](https://dietpi.com/forum/u/kelliegator)\
**Post date:** [8 June 2023 07:52 UTC](https://dietpi.com/forum/t/cant-write-to-samba-share-on-windows-11-despite-changing-the-samba-config/17035/1 "2023-06-08T07:52:46Z")

</div>

### Creating a bug report/issue

#### Required Information

- DietPi version | G\_DIETPI\_VERSION\_CORE=8  
G\_DIETPI\_VERSION\_SUB=18  
G\_DIETPI\_VERSION\_RC=2  
G\_GITBRANCH=‘master’  
G\_GITOWNER=‘MichaIng’
- Distro version | `bullseye 0`
- Kernel version | `Linux DietPi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux`
- Architecture | `arm64`
- SBC model | `RPi 3 Model B (aarch64)`  
Power supply used | Unkown
- SD card used | Sandisk Ultra 16gb

#### Additional Information (if applicable)

- Software title | Samba
- Was the software title installed freshly or updated/migrated?  
Freshly installed
- Can this issue be replicated on a fresh installation of DietPi?  
Yes
- Bug report ID | `48534202-af56-4840-9e3e-d0b67b3abfe9`

#### Steps to reproduce

1. Install Samba
2. Typed in “sed -i ‘/path = /c\path = /mnt/stash/KSMB’ /etc/samba/smb.conf” and then “systemctl restart nmbd smbd”, which gives me read access to the folder via Windows 11 but no write permission.
3. Typed in this into the samba config:  
“[dietpi]  
comment = DietPi Share  
path = /mnt/stash/KSMB  
browseable = yes  
writeable = yes  
read only = no  
force create mode = 0777  
force directory mode = 0777  
create mask = 0777  
directory mask = 0777  
public = yes”

#### Expected behaviour

I should be allowed to write and delete on the folder via Windows 11.

#### Actual behaviour

- Windows 11 tells me I can’t edit files on the folder because I don’t have permission.

#### Extra details

- I’ve searched high and low online for a solution without finding any. I got it to work on a previous installation but can’t remember what I did that made it work then.

---

<div class="post-metadata">

**Author:** ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)\
**Post date:** [8 June 2023 07:56 UTC](https://dietpi.com/forum/t/cant-write-to-samba-share-on-windows-11-despite-changing-the-samba-config/17035/2 "2023-06-08T07:56:03Z")

</div>

Can you show the output of `ls -la /mnt/stash/KSMB` please.

---

<div class="post-metadata">

**Author:** ![kelliegator](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/k/e99b99/32.png) [@kelliegator](https://dietpi.com/forum/u/kelliegator)\
**Post date:** [8 June 2023 08:07 UTC](https://dietpi.com/forum/t/cant-write-to-samba-share-on-windows-11-despite-changing-the-samba-config/17035/3 "2023-06-08T08:07:19Z")

</div>

```auto
drwxrwxrwx 14 nobody nogroup 4096 Jun 6 03:28 .
drwxr-xr-x 12 dietpi dietpi 4096 Jun 8 06:38 ..
-rw-r--r-- 1 nobody nogroup 10244 Jun 7 09:10 .DS_Store
-rw-r--r-- 1 nobody nogroup 4096 Jun 4 20:09 ._.DS_Store
drwxr-xr-x 8 nobody nogroup 4096 Jun 7 17:14 Filmer
drwxr-xr-x 2 nobody nogroup 4096 Jun 4 19:19 IA64
drwxr-xr-x 67 nobody nogroup 4096 Nov 17 2022 Noise
drwxr-xr-x 5 nobody nogroup 4096 May 22 12:27 RUUN
drwxr-xr-x 2 nobody nogroup 4096 Jun 4 19:19 W32ALPHA
drwxr-xr-x 2 nobody nogroup 4096 Jun 4 19:19 W32MIPS
drwxr-xr-x 2 nobody nogroup 4096 Jun 4 19:19 W32PPC
drwxr-xr-x 3 nobody nogroup 4096 Jun 4 19:19 W32X86
drwxr-xr-x 2 nobody nogroup 4096 Jun 4 19:19 WIN40
drwxr-xr-x 2 nobody nogroup 4096 Jun 4 19:19 color
drwxr-xr-x 12 nobody nogroup 4096 Jun 6 06:14 stoof
drwxr-xr-x 3 nobody nogroup 4096 Jun 4 19:19 x64

```

---

<div class="post-metadata">

**Author:** ![Jappe](https://dietpi.com/forum/user_avatar/dietpi.com/jappe/32/1788_2.png) [@Jappe](https://dietpi.com/forum/u/Jappe)\
**Post date:** [8 June 2023 08:26 UTC](https://dietpi.com/forum/t/cant-write-to-samba-share-on-windows-11-despite-changing-the-samba-config/17035/4 "2023-06-08T08:26:52Z")

</div>

It is like the error message stated: You have no permissions to write, only read and execute (assuming you’re using user `dietpi`)  
The permissions you set in your config only account for new created files and folders, not for the already existing ones, they have already their permissions.  
Theroretically you should be able to create files and folders in `/mnt/stash/KSMB`, but not in any subfolder:

```auto
drwxrwxrwx 14 nobody nogroup 4096 Jun 6 03:28 .

```

You could do `chmod 775 /mnt/stash/KSMB ` and `chown nobody:dietpi /mnt/stash/KSMB ` (assuming you are using the user dietpi)

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [8 June 2023 09:05 UTC](https://dietpi.com/forum/t/cant-write-to-samba-share-on-windows-11-despite-changing-the-samba-config/17035/5 "2023-06-08T09:05:26Z")

</div>

> [@kelliegator](#):
>
> /mnt/stash/KSMB

Is this an external device? Can you share following

```auto
lsblk -o name,fstype,label,size,ro,type,mountpoint,partuuid,uuid

```

Was this disk connected to another system before? Strange permissions `nobody nogroup`

---

<div class="post-metadata">

**Author:** ![kelliegator](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/k/e99b99/32.png) [@kelliegator](https://dietpi.com/forum/u/kelliegator)\
**Post date:** [8 June 2023 14:17 UTC](https://dietpi.com/forum/t/cant-write-to-samba-share-on-windows-11-despite-changing-the-samba-config/17035/6 "2023-06-08T14:17:41Z")

</div>

This is the result:

```auto
NAME FSTYPE LABEL SIZE RO TYPE MOUNTPOINT PARTUUID UUID
sda 1.8T 0 disk
└─sda1
     ext4 1.8T 0 part /mnt/stash 05f1ba04-b443-449a-a2fd-73063662fb56
mmcblk0
│ 14.8G 0 disk
├─mmcblk0p1
│ vfat 128M 0 part /boot 2a5aca42-01 DF63-6F01
└─mmcblk0p2
     ext4 14.7G 0 part / 2a5aca42-02 31f1a85e-ab93-4b5a-84a9-02beaaa0c434

```

The reason behind the permission was me previously trying to figure out how to fix the permissions for the drive and whatever I did didn’t work.

---

<div class="post-metadata">

**Author:** ![kelliegator](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/k/e99b99/32.png) [@kelliegator](https://dietpi.com/forum/u/kelliegator)\
**Post date:** [8 June 2023 14:18 UTC](https://dietpi.com/forum/t/cant-write-to-samba-share-on-windows-11-despite-changing-the-samba-config/17035/7 "2023-06-08T14:18:15Z")

</div>

I tried this and Windows still tells me it doesn’t have permission. Should I do it as root instead?

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [8 June 2023 14:35 UTC](https://dietpi.com/forum/t/cant-write-to-samba-share-on-windows-11-despite-changing-the-samba-config/17035/8 "2023-06-08T14:35:01Z")

</div>

Yes pls do this as user `root`. Which user you use on Windows to login to SAMBA share?

```auto
chmod 755 -R /mnt/stash/
chown dietpi:dietpi -R /mnt/stash/

```

---

<div class="post-metadata">

**Author:** ![kelliegator](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/k/e99b99/32.png) [@kelliegator](https://dietpi.com/forum/u/kelliegator)\
**Post date:** [8 June 2023 14:55 UTC](https://dietpi.com/forum/t/cant-write-to-samba-share-on-windows-11-despite-changing-the-samba-config/17035/9 "2023-06-08T14:55:14Z")

</div>

This worked, thanks. But I have another problem that I don’t know if it needs a seperate thread or not but I have a feeling it’s related. I have an emby server on my Raspberry pi and when I try to delete stuff within emby it tells me that I don’t have write permissions to that folder. Why is that?

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [8 June 2023 15:19 UTC](https://dietpi.com/forum/t/cant-write-to-samba-share-on-windows-11-despite-changing-the-samba-config/17035/10 "2023-06-08T15:19:58Z")

</div>

What folder is that?

```auto
chmod 775 -R /mnt/stash/

```

---

<div class="post-metadata">

**Author:** ![kelliegator](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/k/e99b99/32.png) [@kelliegator](https://dietpi.com/forum/u/kelliegator)\
**Post date:** [8 June 2023 15:31 UTC](https://dietpi.com/forum/t/cant-write-to-samba-share-on-windows-11-despite-changing-the-samba-config/17035/11 "2023-06-08T15:31:28Z")

</div>

I don’t know where emby is installed but the folder is /mnt/stash/KSMB/Filmer.

---

<div class="post-metadata">

**Author:** ![kelliegator](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/k/e99b99/32.png) [@kelliegator](https://dietpi.com/forum/u/kelliegator)\
**Post date:** [8 June 2023 15:34 UTC](https://dietpi.com/forum/t/cant-write-to-samba-share-on-windows-11-despite-changing-the-samba-config/17035/12 "2023-06-08T15:34:54Z")

</div>

Nevermind, typing in this fixed it.

---

<div class="post-metadata">

**Author:** ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)\
**Post date:** [8 June 2023 19:15 UTC](https://dietpi.com/forum/t/cant-write-to-samba-share-on-windows-11-despite-changing-the-samba-config/17035/13 "2023-06-08T19:15:45Z")

</div>

Yes, access between different apps is realized on DietPi via group permission. Therefore giving r/w to dietpi group fixed it in your case.
