I'm trying to set up a Samba share that is only accessible by a particular user. I'd like that user to have read/write access to all files in the share.

The smb.conf file below will let me access the share through the one user 'patrick' but I can't get write access to work - I cannot modify or delete files on the mounted share via windows. The user does have the proper permissions set for the directory per below.

How can I enable read/write access? I do not want to change the directory/file permissions to 0777 like many of the other forum posts would suggest.

Directory permissions:

drwxr-xr-x   6 patrick patrick  4096 Jul  3  2015 ./
drwxr-xr-x   3 root    root     4096 Jul  1  2015 ../
drwxrwxr-x+ 15 patrick patrick 65536 Jan 22 00:01 music/

The smb.conf file:

   workgroup = WORKGROUP
        server string = %h server (Samba, Ubuntu)

#   wins support = no
   dns proxy = no
   log file = /var/log/samba/log.%m
   max log size = 1000
   syslog = 0
   panic action = /usr/share/samba/panic-action %d
   server role = standalone server
   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 = never

   usershare allow guests = no

   comment = Music on Ceres
   path = /mnt/largemarge/music
   valid users = patrick
   browseable = yes
   guest ok = no
   read only = no
   create mask = 0775
   directory mask = 0755
   force user = patrick

6 Answers 6


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:




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

  • Can anyone find where the above constraint is documented in the samba man pages? I was unable to find it. Commented Jan 24, 2016 at 6:43
  • 3
    I doubt this is a constraint: on my system, all defined shares (with different access rights) have Share name = Directory name. Exemples: [ze] writeable = yes path = /partages/ze I guess it is rather a limitation on specific directories. Commented Jan 27, 2016 at 14:08
  • That doesn't work for me. Commented May 21, 2021 at 19:04
  • Thank you so much. I had a slightly different scenario, but this fixed it for me. Say I had a share named foo and the path was /home/user/me/foo/share, I could never write to the share from a Windows. Changing the share name to not match the parent directory and restarting did the trick! Commented Sep 1, 2021 at 1:18
  • 1
    Doesn't work. I had to change file ownership to get the write permission. Commented Jan 13, 2022 at 23:42

I've also documented that the Share name and Directory name cannot be the same or the share will be visible and read-only despite the permissions. When the Share name is modified to be different than the Directory (or Disk) name it will become writeable assuming it and the user have the correct permissions.

I found this with NTFS disks and folders mounted in Ubuntu that had been previously shared under NTFS using the same Share names. Win and Linux sharing tools both default to the directory or disk name for their share name during creation so the conflict is built-in by default. Simply adding a character to the Linux Share name made it writeable.

This may or may not be true if the disk or directory are not NTFS or are NTFS but have never been shared. It appears that previously-used NTFS share names are reserved when mounted in Ubuntu and Linux deals with the conflict by making the share read-only.

An NTFS directory share named \My Music simply renamed \My Muzak in Ubuntu is enough to make the directory writeable.

  • Is there any added information in this answer, that was not covered in the answer from Jan 24 2016? Commented Jun 27, 2017 at 15:03

I had the same problem and fixed it with the good ole Windows reboot. I did not have to use a different name.

Changes to smb.conf under Share Definitions:

read only = no
create mask = 0775
directory mask = 0775 

At the end of smb.conf, I added

comment = Samba on Ubuntu
path = /home/fred/sambashare
read only = no
browsable = yes

Above is just for documentation purposes to show all of the changes I made. When I tested trying to write to sambashare, the Share Definitions part was not there. That is the part I added to get everything to work.

Now, after changing the 3 directives under Share Definitions, I restarted the smb service and then tested from Win10. Failed.

Next I rebooted the Linux server and tested. Still failed. Rebooted Win10 and SUCCESS.

So if anyone else has this problem and tries what I posted, I would just restart the smb service and then reboot Windows (as usual). There is probably no need to reboot the linux server. Oh, and before attempting to write to the sambashare, I closed all File Explorer Windows and used a fresh one for each test.

Hope this works for you.


You need to add the user account to the file /etc/samba/smbusers to map the system account to the samba account

user = "user"

New contributor
Jason is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

In Homes:

# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
;   read only = yes

so have you tried "read only = no" to your shares? or "writeable = yes"


The following command entered in a Terminal gave me write access to a Samba file share from an Ubuntu 20.04 desktop client:

sudo mount -t cifs //SMB_IP_Address/SMB_Sharename /SMB_MountPoint -o username=your_smb_username,uid=1000

Your uid may differ if you have configured multiple clients.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .