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.
Unable to write to root directory of SMB share on macOS
macos - Samba share is read-only after upgrading to Mac OS "BigSur" - Stack Overflow
SMB Share and failed write from macOS
samba - Issue with smb share on a linux server connecting from a mac - Unix & Linux Stack Exchange
for what it is worth, I couldn't access my samba share, maybe you have forgotten to add you username to the samba password group (for lack of beter description phrase)
this is what I did to get mine to work
smbpasswd -a username
after by using nautilus, shared my drive/folder with right-click, sharing, etc.
create your password, and use your username and passsword (which you just entered) to access your samba drive, you can also map this drive in Windows
hope this could help
Are the group and owner of the shared folder set properly for the samba user? Should be the same, or try
$ chown -R nobody:nogroup sharedfolder
for testing purposes...
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.
Sorry this doesn't help the OP, but I can confirm that
unix extensions = no
worked for me. I have Macs running Snow Leopard connecting to Linux (lenny/sid) server with Samba 3.2.3. I am posting this so people will still try that. Much like others, before I put the unix extensions = no line in, the force create mode was being ignored.
Samba has two ways of setting perms for an uploaded file:
- Without UNIX extensions: preset file/directory mask is used
- With UNIX extensions (which probably MacOS client has): that allows clients to control file perms
Here's the lines you should add to config file (smb.conf):
# For case 1: no UNIX extensions create mask = 0644 directory mask = 0755 # For case 2: override UNIX extensions force create mode = 0644 force directory mode = 0755
(Should be placed BEFORE any share definition goes: this looks like [share name] in square braces and a couple of indented lines. These sets will then apply to all shares you have)
Also read about force group and force user in man smb.conf, if you need it.
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.

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.