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

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
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
Can't get write permission on a synology SAMBA share from my debian server
One problem here is that you say 'synology SAMBA share', but it really should be 'synology share', synology take an old version of Samba (4.15.x I believe) and add/modify the code, then never share the modifications. If it is a synology code problem, then you need to speak to synology. All I can suggest, check the permissions set on the shares directory (the entire path) and also attempt to manually mount the share. More on reddit.com
🌐 r/linuxquestions
6
2
November 14, 2024
permissions - Samba (Cannot Write) issue - Stack Overflow
I have setup Samba between two linux boxes (Ubuntu Desktop 12.10 and Ubuntu Server 12.04). For some reason I cannot write to my samba share. To me it looks like I have the correct permissions. Below is my smb.conf, the filesystem permissions, and the steps I followed. More on stackoverflow.com
🌐 stackoverflow.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.
🌐
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 - 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:
🌐
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…
🌐
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
Find elsewhere
🌐
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 - That is what uid=1000,gid=1000 does, the first user created in mint has an ID of 1000 and that will give you write access. If the share is not present on boot, mint will keep trying to access it for 90 seconds before giving up, nofail stops that. Bad idea to mount your shares in /. If you are using timeshift (which you should) you don't want it to include the share in your snapshots*. Better to mount somewhere in /mnt or /media, e.g. /mnt/test_rw. * you can exclude it in the settings for timeshift, but better to avoid the problem in the first place.
🌐
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 › 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.
🌐
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…
🌐
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.

🌐
TrueNAS Community
truenas.com › forums › archives › freenas (legacy software releases) › freenas help & support › sharing
Can't write to SMB share from Ubuntu | TrueNAS Community
March 18, 2022 - Try mounting with noperm option. Does your user have Execute permissions for each path component leading to the share path? ... @Decoy256 Change your mount command in Kubuntu. As it is, I think you'll find the mount point is owned by root:root not the desired user:group.
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.

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/fedora › i can access my samba shared folder but can't write. permission denied.
r/Fedora on Reddit: I can access my Samba shared folder but can't write. Permission Denied.
March 4, 2020 -

I setup a Samba shared folder and I can access it through my other linux laptop (manjaro) but I can't write any changes to it. I get a Permission Denied message.

samba config file

Also I did steps 2/3 from this site to make samba work on Fedora 31.

Anyone know how can I make my shared folder writeable by other users mainly my other linux machine (manjaro)?

Thanks