Although I prefer the Samba "force group", "force create mode", and "force directory mode" combination, that approach is effectively obsolete (or at least too much trouble) starting with OS X Lion. Right now, the best solution is to use groups and ACLs.

In System Preferences -> Users & Groups:

  1. Create a new group for the users who need write access to the file share. Do not try to reuse the "staff" group, a new group is required to force ACLs to be created in step 4.
  2. Add the users to the group.

In System Preferences -> Sharing -> File Sharing:

  1. Select the shared folder.
  2. Add the group to the share permissions (click the + under the "Users" list) and give it read/write access.

Check the ACLs on the shared directory and its contents using 'ls -le'. You should see something like this:

-rw-r-----+ 1 scott    staff  43667456 Feb 17 21:59 filename
 0: group:xxx inherited allow read,write,execute,append,...

The permissions are inherited; all group members now have r/w access.

Answer from user1241759 on Stack Exchange
Discussions

macos - Permissions issue when copying files over SMB to server on OS X 10.9 Mavericks - Ask Different
First of all I'd like to say that I've spent most of the day trying to figure this problem out. I've already read quite some articles on this issue but can't seem to find the specific issue I'm More on apple.stackexchange.com
🌐 apple.stackexchange.com
macos - Cannot write to SMB Share with Terminal OS X 10.8 - Ask Different
I am trying to copy some files from my local drive to a SMB share I have set up on my home network using Terminal, but I keep getting this error: fchmod failed: Permission denied The share is set... More on apple.stackexchange.com
🌐 apple.stackexchange.com
November 4, 2012
Write permission denied for SMB share - General Support - Unraid
I am unable to write to a public SMB share (share is exported and public). I am able to read from the share. I am authenticating as a guest. The output of smbstatus while authenticated is: Samba version 4.11.4 PID Username Group Machine Protocol Version Encryption Signing ------------------------... More on forums.unraid.net
🌐 forums.unraid.net
August 29, 2021
Permission errors within an app af… | Apple Developer Forums
After updating from MacOS 14.0 to 14.1 we got permission errors within an app we developed. We got an "operation not permitted" error if the app tries to access files on a samba network share which is mounted by another tool. Additionally, we got a "Permission denied" if the app tries to run ... More on developer.apple.com
🌐 developer.apple.com
🌐
Unraid
forums.unraid.net › home › unraid os support › general support › write permission denied for smb share
Write permission denied for SMB share - General Support - Unraid
August 29, 2021 - I am unable to write to a public SMB share (share is exported and public). I am able to read from the share. I am authenticating as a guest. The output of smbstatus while authenticated is: Samba version 4.11.4 PID Username Group Machine Protocol Version Encryption Signing ------------------------...
🌐
Apple Developer
developer.apple.com › forums › thread › 742019
Permission errors within an app af… | Apple Developer Forums
The app is not sandboxed, the SMB share access was probably blocked by MAC. The tool which mounts the share also executes the app. If giving the tool full disk access it works, I guess because this is inherited to the child process. We also solved the permission denied problem for the ip command.
Find elsewhere
🌐
Apple Community
discussions.apple.com › thread › 7734157
iMac Sierra smb mount: cannot write - Apple Community
November 4, 2016 - Sounds like a permissions issue Server side. macOS Sierra does make a change to SMB where root access is required to write to the drive but the OS should take care of that when you mount the share.
Top answer
1 of 1
10

Note: I'm just guessing here, I'm not a samba guru.

Samba/CIFS, at least the way you're using it here, does not reproduce credentials between the server and the client. Because of the force user directive on the server, all operations are performed as the user erpm on the server. However, because both the client and the server are running a unix system, they auto-negociated the CIFS POSIX extensions. This makes unix permissions appear to work up to a point, but only as far as the server permits, and you've run into a case where what the unix permissions claim and what the server allows differ.

You'll notice that all files appear as user ID 501. That's their uid on the server.

When you try to create or remove a file, this requires write permission on the directory. All access are mapped to a single user on the server, so write permission boils down to whether erpm is allowed to write to that directory on the server. The answer is yes.

When you run touch, it creates the file and then changes its modification time. Changing the modification time of a file requires ownership, and this is tested by the generic filesystem code, on the client side.

If you run strace touch test, you'll notice that then open call (which creates the file) succeeds, then the utimes call (or rather on Linux the utimensat system call) fails to set the times.

This is actually a bit weird because utimes should succeed, since touch calls it with a NULL argument (meaning “set the timestamp to the current time”), and this is supposed to be permitted to any caller that may write to the file, and not only to the owner like setting an arbitrary timestamp. I suspect that utimensat is actually doing a permissions-based check, and determining that the permissions say you can't write to that file, even though the filesystem would allow a write operation regardless of the actual permissions.

The main advantage of the CIFS POSIX extensions when the server side is running with the permissions of a non-root user are to carry over the executable bit, and possibly group ownership. It may be less confusing if you map user ownership to a single client-side user with the forceuid mount option.

🌐
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 - 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 to the pi directly or over ssh/vnc.
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › projects › networking and servers
samba server gives me a permission denied error when connecting - Raspberry Pi Forums
Whatever username you use must exist as a Unix user. you should also create the same user on all computers that will connect to the share, ideally using the same password everywhere. If you are connecting from a Windows 10 machine and it still does not work, then you may have to turn SMBv1 ...
🌐
Super User
superuser.com › questions › 1023925 › give-write-permissions-on-samba-shares
Give write permissions on samba shares - Super User
September 1, 2016 - However, as soon as I attempt to touch a file using the shell or copy files to the share I get Permission denied errors. However, I only get them for folder1 and folder2, in folder3 everything works perfectly. I can't figure out what prevents me from writing to the other folders. Does anyone have any ideas at all? ... If you have any configuration lines that look like they are simply placed after the blocks, the result may be that the configuration line(s) are actually affecting just the last block. In my actually-working Samba configuration, I have this in each block:
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › using the raspberry pi › beginners
Samba fileshare Permission Denied help asked (seems to be a common confusion) [Solved] - Raspberry Pi Forums
June 6, 2023 - OK, guest access should work, except for a few things: Using fat32 on the USB drive, people do have this thing that because they are connecting from Windows, then the filesystem on the USB drive has to be a Windows filesystem. This couldn't be further from the truth, unless the drive is going to plugged into a windows machine. I would advise using a Unix filesystem, the Windows machines do not care what filesystem is on the drive when connecting via Samba, they do not see it.
🌐
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

🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › using the raspberry pi › troubleshooting
Permission denied mounting Mac SMB share after updating to Monterey - Raspberry Pi Forums
//<MacName>.local/Movies /mnt/Movies cifs username=<Mac Username>,password=<Mac Password>,x-systemd.automount This was working fine previously when I was on Catalina but, after upgrading to Monterey, this now gives an error ... mount error(13): Permission denied Refer to the mount.cifs(8) manual page (e.g.
Top answer
1 of 2
1

I'm late to this, but I can't be the person that discovered a solution that worked (for me, at least) without putting it out there, since I've been that guy that screams at the "nvm fixed it" comments with no elaboration ;)

Your very first step is to check your fstab. You need to make sure you have

  1. Enabled xattrs support on the filesystem you're sharing from, check your fstab.

  2. Enabled ACL in mount options too, while you're there. Something like this, adjust for your environ:

    /dev/disk/by-label/nas1 /mnt/nas1 ext4 defaults,user_xattr,acl,commit=60 0 2
    

    I just went through a couple of hours of troubleshooting why I got permission errors. I had simply forgotten point 2.

The rest of my setup was already OK with much less fuss than I thought:

  1. Put this in smb.conf [global] section:

    [global]
    vfs objects = fruit catia streams_xattr acl_xattr
    map acl inherit = yes
    fruit:aapl = yes
    fruit:model = MacSamba
    fruit:metadata = stream
    readdir_attr:aapl_rsize = yes
    readdir_attr:aapl_finder_info = yes
    readdir_attr:aapl_max_access = yes
    

    If you wonder what the settings do, I humbly suggest you $> man smb.conf (not a dig at the OP, I confused the text in their post with another more... ignorant post previously.)

The rest of the file can stay default. Change your workgroup name if you're an old Windows 3.11 guy that cares about syncing that across my LAN.

  1. In the share you want to have tag support for, these options work well for me:
    [Pr0n]
      comment = Pr0n
      path = /mnt/nas1/Pr0n
      browseable = no
      guest ok = no
      read only = no
      writable = yes
      valid users = 
    
    [ -- snip -- ]
    
      force directory mode = 0775
      force create mode = 0664
    
      # Fruit config
      fruit:posix_rename = yes
      fruit:veto_appledouble = yes
      fruit:nfs_aces = yes
      fruit:wipe_intentionally_left_blank_rfork = no
      fruit:delete_empty_adfiles = no
    

The directory is owned by my personal user and group, I did not need to fuddle around with net grant SeDiskOperatorStatus or any of that.

One reboot later (might as well, right) everything was automagically good, and tags are both allowed and stick.

2 of 2
0

It is possible that your PAM (Pluggable Authentication Module) setting is overrules your directory mask and create mask settings. Check the line: obey pam restrictions = no in your smb.conf.Should do the trick.

🌐
OSMC Forums
discourse.osmc.tv › help and support › raspberry pi
OSMC Samba Permission Issue Mac - SOLVED - Raspberry Pi - OSMC Forums
April 23, 2015 - Hello, I am having an issue with Samba on my Raspberry Pi and Mac, I can view files and open them but I cannot write I am being presented with this error message “Items can’t be copied to “Movies” because you don’t have…
🌐
Raspberry Pi Forums
forums.raspberrypi.com › board index › using the raspberry pi › troubleshooting
Samba Write Access Denied Windows 10 - Raspberry Pi Forums
I just ran chmod -R g=rwx /media/hdd4tb/shares/torrents/ and that fixed my issue. Thanks for the help. Hmm, if I physically take that hard drive and connect it to another linux machine instead of using samba shares, how do I keep permissions intact if I'm working with the files?