1

Why can't the macOS machine open any files in the shared folder that were transferred from the Linux machine? The permissions seem to be correct. The shared folder is located on the macOS machine / it owns the shared folder.


I have a shared folder on macOS Catalina (It's just the default Public folder) that can be accessed by an Ubuntu machine. The share is set up using SMB.

If the Linux machine copies over a photo, text file, whatever into the shared folder, the macOS machine cannot open it. I get a permissions error. If the macOS machine does the same, the Linux machine has no problems whatsoever.

I have tried many settings on macOS to no avail including "Apply to enclosed items".

Here's a screenshot of all the sharing settings on macOS so you can see what I have done. Permissions issue

The first screenshot shows the error when the admin account on macOS tries to open any file that was transferred from the Linux machine. The account has read/write permissions to the shared folder. Even if I copy a file to the macOS desktop, the error persists.

The second screenshot shows Sharing settings in System Preferences. The blacked out parts are just the folder name and the two users who have access to said folder. One user is the macOS admin account, the other user is login credentials for the Linux machine.

The third screenshot is details of the shared folder by right clicking > Get Info.

  • macOS Catalina is the machine sharing the folder
  • Ubuntu 20.0.4 can see the shared folder and use it without issue
  • The machines are connected on a local network
  • The Linux machine has it's own login credentials to the shared folder that were set up on the mac. It is not using a "guest" account.
6
  • I tried this and encountered no problems. However, I can not exactly determine what you did. Posting images is not very helpful, since I can not tell what settings you changed and which setting are messed up for some other reason. It would be helpful if you would explain what changes you made in the settings and how exactly you connected to the Mac from the machine running Linux. Also include which Linux you are using. Commented Jun 1, 2022 at 16:35
  • Since you have blackouts in the images, I am guessing you changed some "Read only" to "Read & Write". Or, is this something messed up? Did change the setting so there would be two "everyone" or is this something messed up? Commented Jun 1, 2022 at 16:38
  • What does this mean?: "If the macOS machine does the same, the Linux machine has no problems whatsoever." Does this mean the macOS machine is connecting to the Linux machine, retrieving a file to the Mac, then opening the local copy? Or, do you mean the macOS machine is connecting to the Linux machine, transferring a file to the Linux machine, then the Linux machine is opening the local copy? Or, something else? Commented Jun 1, 2022 at 16:45
  • user898458: After reading your edit, I can somewhat recreate your issue. I say somewhat, because you have not answered all the questions I posted in previous comments. The popup message shown in your posted image is correct. This can be easily verified using the ls command or the Finder application. Now, do you have a question you wish to ask? So far you have yet to post any sentences ending with a question mark. Commented Jun 2, 2022 at 15:04
  • @David Anderson My question is why can't the macOS machine open any files in the shared folder from the Linux machine? The permissions seem to be correct. I did not change the settings for "Everyone". That was by default and it cannot be removed using the remove button you see in the third picture. "What does this mean?:" The macOS machine cannot open files in the shared folder (located on the macOS machine) that were transferred from the Linux machine. That is the permission error seen in the first screenshot. Even if I copy it to the macOS desktop. the error persists.
    – user898458
    Commented Jun 2, 2022 at 17:25

2 Answers 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.

4
  • This is not the answer. Commented Jun 3, 2022 at 17:54
  • Care to explain? I don't think there is enough information in the question to tell if this is the answer or not. I have certainly experienced extended attributes that caused a file to not be readable, when the "regular" read/write/execute for user/group/others indicated it should be readable. Commented Jun 3, 2022 at 18:00
  • The problem is exactly as presented by the OP. The user trying to open the file simply does not have permission to do so. When I was finally able to recreate the OP's situation, I found the transferred file had no extended attributes or ACLs. Commented Jun 3, 2022 at 18:02
  • I don't think it has to do with extended attributes, but permissions. I appreciate your response nonetheless. Here is the output of the command. 1 ➜ ls -la@ * 2 -rw-r--r--@ 1 user898458 staff 6148 28 Nov 18:44 .DS_Store 3 com.apple.FinderInfo 32 4 -rw-r--r-- 1 user898458 staff 0 17 Oct 18:19 .localized 5 -rw------- 1 tux staff 41596 29 Nov 10:20 dalecooper.jpg
    – user898458
    Commented Nov 29, 2022 at 21:07
0

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.

1
  • So, what is the sensible way to resolve this issue? Having to sudo chmod or sudo chown to open the file on the Mac seems ridiculous. That defeats the purpose of having a shared folder... Like I said in my original post, if the Mac copies a file to shared folder, the Linux machine can open it without issue.
    – user898458
    Commented Nov 29, 2022 at 20:09

You must log in to answer this question.

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