1

I've been using a Mac Studio system now for a couple of years, and a now I am running into permissions problems when trying to set up a web server. It was only recently that I noticed ownership issues with files on my system

Here's a snippet of interaction using a terminal to access MacOS through ssh showing some of the problems:

dennis@macstudio:/www/htdocs/functions   11/04 14:01:35
> ls -l
total 15704
drwxr-xr-x@ 9 dennis  staff      288 Mar 22  2015 Emoji-Images-PHP-master
-rw-r--r--@ 1 dennis  staff    16793 Sep  1 07:29 Emoji-Images-PHP-master.zip
-rw-rw-r--+ 1 dennis  staff     6674 Oct 25 20:58 ExclusiveLock.php
-rw-rw-r--+ 1 dennis  staff     4921 Jul  6 14:14 LSClass.php
-rw-rw-r--+ 1 dennis  staff    34654 Sep 30 15:48 OptionsClass.php
-rw-rw-r--+ 1 dennis  staff     4060 Oct 13  2022 RecursiveZip.php
-rw-rw-r--+ 1 dennis  staff    14148 Sep  5 19:00 elapsedClass.php
-rw-rw-r--+ 1 dennis  staff      421 Dec 31  1969 fixes.php
-rw-rw-r--+ 1 dennis  staff   207196 Oct 31 12:33 loveBaseFunctions.php
-rw-rw-r--+ 1 dennis  staff    35637 Jul 10 15:30 loveGPSfunctions.php
-rw-rw-r--+ 1 dennis  staff     3292 Aug 11 14:12 lovefunctions.php
-rw-rw-r--+ 1 dennis  staff     4023 Mar 15  2023 mail-functions.php
-rw-rw-r--+ 1 dennis  staff     3208 Oct  3 17:02 music-bottom.php
-rw-r--r--@ 1 dennis  staff  7640602 Sep  1 07:14 php-emoji-master.zip
-rw-rw-r--+ 1 dennis  staff     1355 Sep  1 17:00 ps-class.php
-rw-rw-r--+ 1 dennis  staff    25349 Aug 16 15:47 send-sms-class.php
-rw-rw-r--+ 1 dennis  staff     7546 Apr 28  2022 sgallery.class.php
dennis@macstudio:/www/htdocs/functions   11/04 14:01:41
> sudo chgrp _www sgallery.class.php
dennis@macstudio:/www/htdocs/functions   11/04 14:02:12
> ls -l sgallery.class.php
-rw-rw-r--+ 1 dennis  staff  7546 Apr 28  2022 sgallery.class.php
dennis@macstudio:/www/htdocs/functions   11/04 14:02:17
> sudo ls -l
total 15784
-rw-r--r--+ 1 _unknown  _unknown    40960 Jul 10 10:42 .loveGPSfunctions.php.swp
drwxr-xr-x@ 9 _unknown  _unknown      288 Mar 22  2015 Emoji-Images-PHP-master
-rw-r--r--@ 1 _unknown  _unknown    16793 Sep  1 07:29 Emoji-Images-PHP-master.zip
-rw-rw-r--+ 1 _unknown  _unknown     6674 Oct 25 20:58 ExclusiveLock.php
-rw-rw-r--+ 1 _unknown  _unknown     4921 Jul  6 14:14 LSClass.php
-rw-rw-r--+ 1 _unknown  _unknown    34654 Sep 30 15:48 OptionsClass.php
-rw-rw-r--+ 1 _unknown  _unknown     4060 Oct 13  2022 RecursiveZip.php
-rw-rw-r--+ 1 _unknown  _unknown    14148 Sep  5 19:00 elapsedClass.php
-rw-rw-r--+ 1 _unknown  _unknown      421 Dec 31  1969 fixes.php
-rw-rw-r--+ 1 _unknown  _unknown   207196 Oct 31 12:33 loveBaseFunctions.php
-rw-rw-r--+ 1 _unknown  _unknown    35637 Jul 10 15:30 loveGPSfunctions.php
-rw-rw-r--+ 1 _unknown  _unknown     3292 Aug 11 14:12 lovefunctions.php
-rw-rw-r--+ 1 _unknown  _unknown     4023 Mar 15  2023 mail-functions.php
-rw-rw-r--+ 1 _unknown  _unknown     3208 Oct  3 17:02 music-bottom.php
-rw-r--r--@ 1 _unknown  _unknown  7640602 Sep  1 07:14 php-emoji-master.zip
-rw-rw-r--+ 1 _unknown  _unknown     1355 Sep  1 17:00 ps-class.php
-rw-rw-r--+ 1 _unknown  _unknown    25349 Aug 16 15:47 send-sms-class.php
-rw-rw-r--+ 1 _unknown  _unknown     7546 Apr 28  2022 sgallery.class.php

The first two issues I see with the above (there are many):

  1. I used sudo to change group ownership of a file to _www, and no error is issued. Then, when listing the file, its group ownership still seems to be unchanged.

  2. When using sudo to view ownership of these files, I get a different result from the same command using my own ID. (2b) The superuser result seems less informative than the normal-user result.

I'm afraid I'm not going to make much progress in my goal until I understand the reason(s) for these things. As an AIX/HP-UX/unix/linux administrator with over 30 years of highly technical development experience, I am baffled by both of these conditions. How does a *nux tech get a handle on Darwin's filesystems and file management, especially from a command-line perspective?

Note that /www is actually a link:

lrwxr-xr-x   1 root  wheel    26 Nov  3 11:31 www -> Volumes/Satechi.SSD.M2/www

Here is the output of the mount command with no parameters or switches:

> mount
/dev/disk3s1s1 on / (apfs, sealed, local, read-only, journaled)
devfs on /dev (devfs, local, nobrowse)
/dev/disk3s6 on /System/Volumes/VM (apfs, local, noexec, journaled, noatime, nobrowse)
/dev/disk3s2 on /System/Volumes/Preboot (apfs, local, journaled, nobrowse)
/dev/disk3s4 on /System/Volumes/Update (apfs, local, journaled, nobrowse)
/dev/disk1s2 on /System/Volumes/xarts (apfs, local, noexec, journaled, noatime, nobrowse)
/dev/disk1s1 on /System/Volumes/iSCPreboot (apfs, local, journaled, nobrowse)
/dev/disk1s3 on /System/Volumes/Hardware (apfs, local, journaled, nobrowse)
/dev/disk3s5 on /System/Volumes/Data (apfs, local, journaled, nobrowse, protect)
map auto_home on /System/Volumes/Data/home (autofs, automounted, nobrowse)
/Applications/Wyze.app/Wrapper on /private/var/folders/ss/3jk0vz155yn0fxx5_8mbwck40000gn/X/30815BCE-C575-5C5C-9D41-BFCC4EDE2A30 (nullfs, local, nodev, nosuid, read-only, nobrowse, mounted by dennis)
/dev/disk4s1 on /Volumes/Gloria (exfat, local, nodev, nosuid, noowners, noatime)
/dev/disk7s1 on /Volumes/Satechi.SSD.M2 (apfs, local, nodev, nosuid, journaled, noowners)
/dev/disk6s1 on /Volumes/T7Gray (exfat, local, nodev, nosuid, noowners, noatime)
/dev/disk9s2 on /Volumes/16TB (apfs, local, nodev, nosuid, journaled)

The Satechi.SSD.M2 filesystem is APFS: enter image description here

10
  • 2
    Is the path really /www/… or are parts missing? Which filessystem is used to store these files?
    – nohillside
    Commented Nov 4, 2023 at 18:32
  • 1
    How did you mount this? I see a checkmark in front of the „ignore ownership“ option at the bottom of the Info window. This would explain the behavior you are seeing.
    – nohillside
    Commented Nov 4, 2023 at 19:43
  • 1
    Could you please edit you OP with the following command and its output- mount
    – fd0
    Commented Nov 4, 2023 at 20:17
  • 3
    File ownership on external volumes is ignored by default. You have to uncheck the "Ignore ownership" box, after clicking the the padlock icon and authenticating as administrator.
    – Linc D.
    Commented Nov 4, 2023 at 20:32
  • 1
    Here's a comand that will take you a section in the hdiutil manual. It's a pretty good explanation of ignore owners- man -P 'less -p "^PERMISSIONS VS. OWNERS"' hdiutil
    – fd0
    Commented Nov 6, 2023 at 22:20

1 Answer 1

1

By default, macOS ignores ownership of files on volumes that are hosted on external storage devices (unless they're in use as a Time Machine backup destination.)

To enable ownership, select the volume icon in the Finder and open the Info window. Click the padlock icon in the lower right corner and authenticate as an administrator. Then uncheck the box in the lower left corner labeled Ignore ownership on this volume.

This setting doesn't change anything on the volume. It creates an entry in a database local to that Mac. If the storage device is connected to another Mac, the corresponding setting on that Mac will be applied.

You should only take this step if you trust the contents of the volume. Otherwise you could be enabling a security exploit, if there is an executable on the volume with the SUID bit set.

1
  • Yes, this is consistent with what I found. I have made the change and the problem is solved. Thank you very much for your help.
    – Dennis
    Commented Nov 6, 2023 at 23:40

You must log in to answer this question.

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