After hours of searching, I discovered that the share name and the share directory cannot be the same (and it's not case-sensitive, either). See this post on serverfault.

So, if I change my share name in smb.conf from:

[Music]

to

[Tunes]

I can both read and write to the share. No other changes to my smb.conf were necessary, and no need to chmod 0777.

Answer from the_meter413 on askubuntu.com
Discussions

Can't write to samba share on Windows 11 despite changing the samba config
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 ... More on dietpi.com
🌐 dietpi.com
12
0
June 8, 2023
debian - Can't make samba share writable - Unix & Linux Stack Exchange
I'm trying to make my samba share (running on Debian 10) writable but it seems that anything I try just breaks the share and I cannot access it anymore. ... [MediaServer4TB] comment = Media Server 4TB browseable = yes path = /media/sf_filesrvr guest ok = no read only = no create mask = 0600 directory mask = 0700 security = user encrypt passwords = yes force user = root writeable ... More on unix.stackexchange.com
🌐 unix.stackexchange.com
May 1, 2022
Unable to write to SMB share
Hi all, I've seen a couple of posts related to this but none seem to have an actual resolution that works for me. I've recently upgraded from v11 to v12.0-U6.1 and had an issue with the USB stick it was previously installed on, so I replaced it with an SSD. The install went fine and I managed... More on truenas.com
🌐 truenas.com
4
November 19, 2021
readwrite - Can't Write to Samba Share - Raspberry Pi Stack Exchange
I've a Raspberry Pi acting as a NAS server. It correctly mounts my drive and shares it through Samba, however, even though I can connect to the share and read stuff, I can't write anything to the d... More on raspberrypi.stackexchange.com
🌐 raspberrypi.stackexchange.com
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › projects › networking and servers
[SOLVED]SAMBA: Can read but can't write to shared drive - Raspberry Pi Forums
The 'root' group has 'read' and 'entry/execute' permissions on the share, the same goes for any other user. If you just want a share anybody can read and write to, just change the permissions for others 'chmod 777 /media/USBHDD1/shares' For more info see here: https://wiki.samba.org/index....
🌐
Arch Linux Forums
bbs.archlinux.org › viewtopic.php
[SOLVED] Can't write to Samba share on client without chown / Newbie Corner / Arch Linux Forums
I have set up a Samba share on my server that only allows users with the name "smbuser" and the group "smbgroup" to access the share. Said user and group exist on the server. The issue I am having is that on any client machine, the share cannot be written to unless I use `chown myuser -R /mnt/my-share` or sudo privileges.
🌐
Linux Mint Forums
forums.linuxmint.com › board index › main edition support › networking
[SOLVED] Unable to write to Samba Share - Linux Mint Forums
September 7, 2025 - After some updates to the credentials and the uid/gid, it appears to be working now! Appreciate the point in the right direction. Can also confirm, the root directory was something created for testing. Once I had the right info, I did place it where I originally planned under /mnt ... altair4 wrote: Sun Sep 07, 2025 6:25 am Just an additional note: The dir_mode=0777,file_mode=0777,noperm will create a "view" of the share that allows everyone read / write access to the share - on the client.
🌐
DietPi
dietpi.com › troubleshooting
Can't write to samba share on Windows 11 despite changing the samba config - Troubleshooting - DietPi Community Forum
June 8, 2023 - 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 v…
🌐
Stack Exchange
unix.stackexchange.com › questions › 701039 › cant-make-samba-share-writable
debian - Can't make samba share writable - Unix & Linux Stack Exchange
May 1, 2022 - security = user is a global setting and cannot be in the share definition. (See man smb.conf and notice that the definition has (G) after it rather than (S), showing it much be in the global section ... This awnser solves the problem in case you can mount your share properly with an user/passwd pair and you are able to read the content of the share from a remote client, but you can't write into the share. Of course you need a section in your /etc/samba/smb.conf like this:
Find elsewhere
🌐
LinuxQuestions.org
linuxquestions.org › questions › linux-networking-3 › can't-write-to-samba-share-4175706103
[SOLVED] Can't write to samba share
I have an OpenMediaVault server with Samba shares. I can mount them remotely but I can't write to them. I've wrestled with this problem quite a bit in
🌐
TrueNAS Community
truenas.com › forums › archives › general help › general
Unable to write to SMB share | TrueNAS Community
November 19, 2021 - @Johnpants Your mistake was not to create datasets within your pool. As you've found out, you cannot change the "root dataset" permissions via the WebUI, nor create "root user" SMB shares. If you need to delete the originals then just use the TrueNAS shell and delete folders/files directly ...
Top answer
1 of 1
5

Looks like you created a folder miguel in the media and you have taken ownership of it. Instead, let's create a group, add users to that group, and set the permissions.

sudo groupadd -g 10000 [samba_group]
sudo adduser migeul [samba_group]
sudo chown root:[samba_group] -R /media/migeul
sudo chgrp [samba_group] /media/migeul
sudo chmod 775 -R /media/migeul

This will create a group and attach it to the folder to be shared. You add the users to that group for access. Set the permissions to 775 which gives the owner and the group read-write-execute access while others only read. Set's it recursively.

Verify that you have total access to the folder. With samba, setting the permissions are a little bit different than file permissions with a ubuntu user. What I mean is that verify the permissions after you take ownership because they could result in a samba error later on down the road. Where nobody can access the drive.

Create a samba account that matches your Linux username precisely.

sudo smbpasswd -a miguel
sudo smbpasswd -e migeul

That will prompt you to create a password for the username miguel. Please note that this is only for SMB shares not for the user in the Operating System.

Afterward, open up the samba config and when sharing the drive make sure you type in writable = yes, browsable = yes, read only = no and add your group to it as well. Also, verify the location you are sharing from. Use the place that it is mounted to.

[migeul]
comment = Migeuls folder
​path = /media/migeul
​browsable = yes
​writable = yes
​guest ok = no
​read only = no
​valid users = @[samba_group]

After you reconfig the /etc/samba/smb.conf file, reload it.

sudo smbd reload

These pages go more in-depth with setting up samba shares.

https://help.ubuntu.com/community/Samba/SambaServerGuide https://www.techrepublic.com/article/how-to-set-up-samba-shares-for-groups/

You may also need to set your umask as well. To do that open up /etc/profile using sudo nano /etc/profile and at the bottom type in umask 002. Use Control+O to save and Control+X to exit. Best to reboot the server using sudo reboot and the new mask permissions will take place. That setting re-asserts the same permissions for the users.

🌐
Reddit
reddit.com › r/homelab › cannot write to smb share
r/homelab on Reddit: Cannot write to SMB share
January 24, 2022 -

Hey there!

Currently, I can read and execute from the share, but am unable to write to the share. I can write when using the CLI on the server itself, but cannot write when using the share from the client.

I am using Samba 4.13.13-Debian on a Debian 11 server. This is my /etc/samba/smb.conf on the server:

[global]
         server role = standalone server
         map to guest = never
         usershare allow guests = no
         hosts allow = 127.0.0.1 192.168.1.0/24
         hosts deny = 0.0.0.0/0
         security = user
         ntlm auth = true  
[share]
         comment = root
         path = "/root/svr_storage_main/"
         read only = no
         browseable = yes
         writeable = yes
         create mask = 0777
         directory mask = 0777
         guest ok = no
         force user = alex
         force group = alex
         valid users = alex 

And my /etc/fstab on the host that mounts the share:

{SHARE_PATH_REDACTED} /home/alex/svr_share    cifs    username=alex,password={PASSWORD_REDACTED},file_mode=0777,dir_mode=0777    0       0 

The permissions for both the root folder of the share on the server and the root folder that the share is mounted to on the client has been set recursively to drwxrwxrwx as well.

Is there any reason that you can see why this may still not allow me to write to the share?

EDIT: formatted code block section for readability.

Top answer
1 of 5
103

I recommend to create a dedicated user for that share and specify it in force user(see docs).

Create a user (shareuser for example) and set the owner of everything in the share folder to that user:

adduser --system shareuser
chown -R shareuser /path/to/share

Then add force user and permission mask settings in smb.conf:

[myshare]
path = /path/to/share
writeable = yes
browseable = yes
public = yes
create mask = 0644
directory mask = 0755
force user = shareuser

Note that guest ok is a synonym for public.

2 of 5
6

In the share settings in smb.conf, you'll need to specify the names of users and/or groups that are allowed to write to the share, using a write list = ... line.

Example:

[myshare]
...
write list = my_linux_username

Then you'll need to use the smbpasswd command to set up a password to authenticate my_linux_username for Samba:

sudo smbpasswd -a my_linux_username

This step is necessary because the standard system passwords in /etc/shadow are hashed in algorithms that are incompatible with the password hash algorithms used in the SMB protocol. When a client sends a SMB authentication packet, it includes a hashed password. It can only be compared to another password hash that uses the same algorithm.

(Very, very old instructions from the previous millennium may recommend disabling password encryption in Samba, and using certain registry hacks to allow Windows to emit unencrypted passwords to the network. This advice is obsolete: those registry hacks may no longer work in current versions of Windows, and allow anyone who can monitor your network traffic to trivially capture your password.)


There's one more thing you may have to do client-side. When your Windows client system is joined to an Active Directory domain and you're logged in with an AD account, it automatically prefixes all unqualified usernames with the name of the AD domain of the user, i.e. you will be authenticating as AD_DOMAIN\your_username, not just your_username.

If you are logged in with a local account (or your client system is not joined to an AD domain), Windows may automatically prefix the username with the client hostname unless you specify another domain name.

To successfully log in to a stand-alone Samba server from a stand-alone Windows client, you may have to specify your username as SAMBA_SERVER_HOSTNAME\your_username.

Otherwise Samba will see the username as WINDOWS_CLIENT_HOSTNAME\your_username, conclude that it has no way to verify any users belonging to domain named WINDOWS_CLIENT_HOSTNAME, and will reject the login.

(Newer versions of Samba may have a built-in check for this specific situation, and they might allow you access nevertheless. But this is basically how SMB authentication works "under the hood", and if you need to deal with old versions of Samba, it might be useful still.)

🌐
Reddit
reddit.com › r/linuxquestions › can't get write permission on a synology samba share from my debian server
r/linuxquestions on Reddit: Can't get write permission on a synology SAMBA share from my debian server
November 14, 2024 -

Greetings all,

I am fairly new to this, so please accept my apologies in advance :P

So I have debian12 running in a VM (proxmox), I have several apps running like heimdal, immish, emby... that sort of things.

I am trying to install manyfold, but the container apparently needs read permissions, except my files are stored on a synology nas (samba share).

root has access, no problem, but when I switch to my normal user, indeed, I can't write in those folders.

This is my FSTAB : as you can see I have several folders mounted, but I can't write in any of them. There is read/write permissions for the user "batuu" on my synology nas. I tried to mount 3Dfiles with 2 different lines, but no dice so far.

Halp !

startide@halcyon:/media/share$ nano /etc/fstab
GNU nano 7.2                                                                                                       /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# systemd generates mount units based on this file, see systemd.mount(5).
# Please run 'systemctl daemon-reload' after making changes here.
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
# / was on /dev/sda1 during installation
UUID=5cc0304f-07ea-4b83-bc7e-298a7cd6b190 /               ext4    errors=remount-ro 0       1
# swap was on /dev/sda5 during installation
UUID=0b652e05-ecff-4e01-b28c-1f0191ee7100 none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0
#network share for emby
//192.168.1.25/movies /media/share/movies cifs username=batuu,password=redacted 0 0
//192.168.1.25/series /media/share/series cifs username=batuu,password=redacted 0 0

#network share for himlish
//192.168.1.25/photos /media/share/photos cifs username=batuu,password=redacted 0 0

#network share for manyfold
# //192.168.1.25/3Dfiles /media/share/3Dfiles cifs uid=1000,gid=1000,username=batuu,password=redacted,uid=1000,gid=1000 0 0
//192.168.1.25/3Dfiles /media/share/3Dfiles cifs guest,uid=1000,username=batuu,password=redacted,iocharset=utf8,file_mode=0777,dir_mode=0777,noperm 0 0
🌐
Reddit
reddit.com › r/linuxquestions › samba share won't let me write to it
r/linuxquestions on Reddit: Samba share won't let me write to it
January 24, 2024 -

Basically I have 4 hard drives that I have mounted in a USB dock that's connected to my Proxmox box and passed through to Ubuntu server. For some reason when I mounted the drive, I can see it but it refuses to let me write to it.

I'm open to other ideas if there's something better. Not looking to use TrueNAS or anything else like that due to the fact that it cannot see all 4 of the drives from that stack. Ideally I'd stick with Ubuntu server. I have considered SFTP, but was hoping to get samba shares up for simplicity so my SO can use it without frustration.

Here's what I have setup so far after reading a handful of different stack overflow suggestions, none of them worked.

🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › using the raspberry pi › troubleshooting
Cannot get write access on a samba shared drive - Raspberry Pi Forums
November 6, 2023 - Add force user = root to your share definition. I really, really, don't recommend doing thsi though. Change your mount options to include uid=nobody,gid=nogroup. This will allow your Samba guest clients write access but you'll still hit permissions with other Linux users e.g when logged in ...
🌐
Manjaro Linux
forum.manjaro.org › support › network
Can't write to samba share - Network - Manjaro Linux Forum
April 28, 2021 - Hello everybody, I am trying to conduct Samba sharing between 2 Manjaro XFCE systems. I want to be able to mainly write on computer A from computer B. The reason is, the HDD on computer B has got corrupted and I have to…
🌐
TrueNAS Community
truenas.com › forums › truenas core › general discussion
Can't get write access to SMB share on new pool. | TrueNAS Community
July 7, 2023 - Did you create an Dataset on the new pool and edited the permissions? Because it sounds like you tried to share out the root Dataset which is not possible because it is always owned by root and root can no longer be used to access smb shares.