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.

Answer from Harley Frank on askubuntu.com
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.

🌐
GL.iNet
docs.gl-inet.com › router › en › 4 › faq › macos_cannot_write_samba
MacOS cannot write to a Samba share - GL.iNet Router Docs 4
Log in to your router’s web Admin Panel, and verify the shared folder has "Read/Write" permissions enabled for your user account. Use the cp -X file-name command to copy the file. Since Finder automatically adds extended attributes (e.g., resource forks, metadata) during transfers, which ...
Discussions

Unable to write to root directory of SMB share on macOS
Hi, It might be after the 11.2-U2 update or it might be changes I made to the share (not sure). But I've noticed that since a few weeks ago, I can't write to one of the SMB root directories. I can write to subfolders, just not the root. From a Windows PC it works fine with no issues, just not... More on truenas.com
🌐 truenas.com
11
April 24, 2019
macos - Samba share is read-only after upgrading to Mac OS "BigSur" - Stack Overflow
Just list all the users you want ... on your linux box too. Mine are. Replace [devshare] with whatever your samba share point is. 2021-12-13T18:15:30.453Z+00:00 ... Find the answer to your question by asking. Ask question ... See similar questions with these tags. ... 15 Samba 4.10 server config: using module "vfs_fruit" changes file creation mask for Mac clients, and I cannot control ... More on stackoverflow.com
🌐 stackoverflow.com
SMB Share and failed write from macOS
Hi Team, read works, but write fails, I get this error in the logs Wed May 29 16:14:00 2024 daemon.err smbd[14486]: [2024/05/29 16:14:00.472911, 0] ../../source3/modules/vfs_fruit.c:2576(fruit_pwrite_meta_netatalk) Wed May 29 16:14:00 2024 daemon.err smbd[14486]: fruit_pwrite_meta_netatalk: ... More on forum.gl-inet.com
🌐 forum.gl-inet.com
1
0
May 29, 2024
samba - Issue with smb share on a linux server connecting from a mac - Unix & Linux Stack Exchange
Explore your Mount/Read/Write/Execute problems with https://github.com/waltinator/pathlld, a bash script to show the permissions, mount options along the path to an object or objects. Is your Mac UID:GID 0:0? For ancient security reasons NFS remaps 0:0 to nobody:nobody. ... rhel 9 and samba 4.20.2. I just noticed I cannot change permissions on another linux ... More on unix.stackexchange.com
🌐 unix.stackexchange.com
November 25, 2024
🌐
TrueNAS Community
truenas.com › forums › archives › freenas (legacy software releases) › freenas help & support › sharing
SOLVED - Unable to write to root directory of SMB share on macOS | TrueNAS Community
April 24, 2019 - Server role: ROLE_DOMAIN_MEMBER # Global parameters [global] allow trusted domains = No client ldap sasl wrapping = plain deadtime = 15 disable spoolss = Yes dns proxy = No domain master = No dos charset = CP437 hostname lookups = Yes kernel change notify = No lm announce = Yes load printers = No local master = No logging = file max log size = 51200 max open files = 941744 nsupdate command = /usr/local/bin/samba-nsupdate -g obey pam restrictions = Yes preferred master = No printcap name = /dev/null realm = INTERPRINT.LOCAL security = ADS server min protocol = SMB2_02 server role = member serve
🌐
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
#======================= Global Settings ======================= [global] security = user ## Browsing/Identification ### # Change this to the workgroup/NT-domain name your Samba server will part of workgroup = WORKGROUP # Windows Internet Name Serving Support Section: # WINS Support - Tells the NMBD component of Samba to enable its WINS Server # wins support = no # WINS Server - Tells the NMBD components of Samba to be a WINS Client # Note: Samba can be either a WINS Server, or a WINS Client, but NOT both ; wins server = w.x.y.z # This will prevent nmbd to search for NetBIOS names through DNS.
🌐
GitHub
github.com › dperson › samba › issues › 309
cannot write · Issue #309 · dperson/samba
I run the samba docker on linux, mount on a mac. Reading works fine, but I cannot write to the mount from the mac. I have tried the -p option, but this changes all my file ownerships and groups, then I cannot even create files on the hos...
Author   dperson
Find elsewhere
🌐
Stack Exchange
unix.stackexchange.com › questions › 787194 › issue-with-smb-share-on-a-linux-server-connecting-from-a-mac
samba - Issue with smb share on a linux server connecting from a mac - Unix & Linux Stack Exchange
November 25, 2024 - If Samba cannot create these extended attributes, it cannot support the full set of Mac and Windows permissions interfaces, which might cause problems in operations like chmod through Samba.
🌐
GitHub
github.com › gl-inet › docs4.x › blob › master › docs › en › docs › faq › macos_cannot_write_samba.md
docs4.x/docs/en/docs/faq/macos_cannot_write_samba.md at master · gl-inet/docs4.x
Log in to your router’s web Admin Panel, and verify the shared folder has "Read/Write" permissions enabled for your user account. Use the cp -X file-name command to copy the file.
Author   gl-inet
🌐
Apple Community
discussions.apple.com › thread › 7734157
iMac Sierra smb mount: cannot write - Apple Community
November 4, 2016 - 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. Have you tried mounting another SMB share to see if you get the same issue? ... I can mount shares from other Macs without problem, so I do suspect the root access is the issue. The server is a Linux box, though I doubt that really matters.
🌐
Reddit
reddit.com › r/linuxquestions › help with connecting mac to linux samba- works fine on windows
r/linuxquestions on Reddit: Help with connecting Mac to Linux Samba- works fine on windows
April 11, 2023 -

So I have a old PC running Ubuntu, and have a big hdd in that pc that I set up as a shared drive for my other computers. I have a laptop running Windows 10, and I am able to connect to it with samba no problem. I can access files, add, etc.

Recently got a new Mac. It’s literally 3 days old. Tried connecting to the same server, using the same credentials, and it doesn’t work. I tried creating a new user on the Linux box and added that user to samba with a password and added it to the valid use list at the bottom of the slb.conf file, and tried with those credentials, but still nothing works.

Is there some setting or something that has to be done to allow a Mac OS system to connect, where a windows PC is working perfectly fine? I’m a fairly novice linux user.

Fwiw, in macOS, I did make sure the server connection is checked in finder settings.

Appreciate any help.

🌐
OS X Daily
osxdaily.com › 2010 › 05 › 02 › simple-fix-for-mac-os-x-10-6-3-samba-write-access-problem
Simple fix for Mac OS X 10.6.3 Samba Write Access problem
May 2, 2010 - Fixing the Samba/SMB write access problem in 10.6.3: * Open smb.conf on the samba server in your favorite text editor sudo nano /etc/smb.conf * Find the global samba settings section under [global] and add the following line: unix extensions = no * Save and close smb.conf (in nano, Control-O followed by the return key to save, then Control-X to exit) * Restart the smb server · The cause of the SMB error in Mac OS X 10.6.3: After digging around I found the cause on SplatDot, and I can confirm I had the same error messages pertaining to wide links and unix extensions enabled at the same time, two parameters which are incompatible.
🌐
Apple Community
discussions.apple.com › thread › 254603764
Unable to write or read file from SMB sha… - Apple Community
February 3, 2023 - I even unloaded and reloaded the Samba daemon in terminal but it’s still not working nor can I turn it off in Settings. Does anyone know why or have had similar problems? 2762 10 · in Finder cannot search files for a SMB sharing drive I shared the drive using SMB, then find I cannot find files in Finder under this drive. It is just empty(not search) and show searching... I googled some articles says it is a bug but I cannot find how to update the SMB package in macOS ...
🌐
GitHub
github.com › openwrt › packages › issues › 11369
samba4-server: macOS cannot write to network share · Issue #11369 · openwrt/packages
February 18, 2020 - Description: Cannot copy files to or modify files on Samba4 network share from Macbook Air (2013) running macOS Sierra (10.12.6). Can successfully read files (watch movie, open text document). On a Windows 10 computer, can successfully write and copy to network share.
Author   openwrt
Top answer
1 of 2
1

In this situation, when the file is transferred, the owner of the file by default is the user which performed the transfer. In this case, this is not the user who owns the shared folder. Also, the basic attributes were not transferred. Instead, the mode bits were set to 0060, which only gives read/write permission to the file owner. In the OP's question, the user who tried opening the file is not the owner of the file. Therefore, permission was denied and the popup message shown the OP's question was presented.


I should point out that according to this post, the owner of the file or folder can be determined from the corresponding Finder info window. Under Sharing & Permissions, the owner is the last user shown in the Name column. Note also that the root user will have the name of system.

For example, the image below shows two users: davidanderson and ronjanzen. Since ronjanzen is the last user shown, ronjanzen is the owner of the folder RonShare.

2 of 2
0

I suspect you have one or more extended attributes set.

These are arbitrary strings or binary metadata about a file. A file can have any number of these, and there are not really any standards for them, except within OS vendors. Thus, Linux can have it's own set, and MacOS can have its own set, explaining the behaviour you observe.

If you want to learn more about these, here is a good resource.

But if you just want to get rid of them, you're going to have to use Terminal commands.

You can try ls -la@ * in your directory to see if any of your files (or more importantly, the directory they live in) have any extended attributes.

If you see something suspicious in the list, you can use xattr -d com.apple.AttributeName * to remove all the extended attributes with the name com.apple.AttributeName — substituting what you think is suspicious for "AttributeName", of course.

You may see a number of com.apple.FinderInfo attributes. They are probably not the problem. That's where the Finder stores things like file tags.

If you report back here what ls -la@ shows you, perhaps we can figure out if this is the problem, and if so, which attributes you should nuke to get rid of it.