The Shell Crossover
The Shell Crossover, Part 6: Permissions, Ownership, and sudo on macOS
Map Windows permission and elevation habits to macOS ownership, POSIX modes, ACL inspection, sudo, root, admin users, and SIP boundaries.
Windows administrators bring useful instincts to permissions work: inspect before changing, know the execution context, and avoid broad inheritance mistakes. macOS uses a different permission model, so the commands and risk points change.
This article maps Windows permission habits to macOS ownership, POSIX modes, ACL inspection, sudo, and System Integrity Protection.
The short translation
| Windows concept | macOS concept | Notes |
|---|---|---|
| Owner | Owner | Every file has an owning user. |
| Primary group or ACL groups | Group | Every file has an owning group. |
| Users or Everyone permissions | Other mode bits | POSIX permissions include owner, group, and other. |
| NTFS ACLs | POSIX modes plus optional ACLs | macOS can show ACLs with ls -le. |
| Run as administrator | sudo | Elevates one command after authorization. |
| LocalSystem | root | Similar power level, not the same service model. |
| UAC prompt | sudo authentication | The user must be allowed to use sudo. |
| Windows Resource Protection | SIP and sealed system protections | Some OS paths are protected even from root. |
Reading POSIX permissions
Start in a safe lab path.
mkdir -p /tmp/admincrossover-permissions-lab
cd /tmp/admincrossover-permissions-lab
echo "sample" > sample.txt
ls -l sample.txtExample output:
-rw-r--r-- 1 jsmith staff 7 May 31 12:00 sample.txtRead it from left to right:
- File type
rw- Owner can read and write
r-- Group can read
r-- Other can read
jsmith Owner
staff GroupDirectories use the execute bit differently than files. On a directory, execute means the user can traverse the directory.
mkdir example-dir
ls -ld example-dirUsing chmod safely
Change a file to owner read and write only.
chmod 600 sample.txt
ls -l sample.txtAdd execute for the owner.
chmod u+x sample.txt
ls -l sample.txtRemove execute again.
chmod u-x sample.txt
ls -l sample.txtPowerShell can call the same native commands.
$LabPath = "/tmp/admincrossover-permissions-lab"
New-Item -ItemType Directory -Path $LabPath -Force | Out-Null
Set-Location -Path $LabPath
Set-Content -Path "sample.txt" -Value "sample"
& /bin/ls -l "sample.txt"
& /bin/chmod 600 "sample.txt"
& /bin/ls -l "sample.txt"Use symbolic modes while learning. chmod u+x file is easier to audit than a number if you are not fluent in octal notation.
Ownership and groups
Inspect owner and group with ls or stat.
ls -l sample.txt
stat -f "%Sp %Su %Sg %N" sample.txtChange group to staff only in the lab path.
chgrp staff sample.txt
ls -l sample.txtChanging owners generally requires elevation.
sudo chown root:wheel sample.txt
ls -l sample.txt
sudo chown "$USER":staff sample.txtThat example is safe because it stays inside /tmp/admincrossover-permissions-lab. Do not practice recursive ownership changes in /Applications, /Library, /System, or a user’s home folder.
Inspecting ACLs
POSIX mode bits are not the whole story. macOS can also apply ACLs. Use ls -le to inspect them.
ls -le sample.txtPowerShell version:
& /bin/ls -le "sample.txt"Do not assume that chmod 755 tells the whole effective-permission story. Check ACLs when behavior does not match the POSIX mode bits.
sudo is not a permanent state
sudo runs a command with elevated privileges after authorization.
sudo ls /var/dbIt is closer to “run this command elevated” than “be an administrator forever.” The user must be allowed to use sudo, commonly through admin-group membership and the system sudoers configuration.
PowerShell does not turn into an elevated shell by itself on macOS. You still call native commands with sudo when elevation is needed.
& /usr/bin/sudo /bin/ls /var/dbWhen you script with sudo, remember that non-interactive management contexts may not have a user present to type a password. In MDM workflows, prefer a true management context rather than expecting an interactive sudo prompt.
root is powerful, but not unlimited
The root user is the Unix superuser, but modern macOS includes protections that limit changes to protected operating system locations. System Integrity Protection restricts modifications to protected files and folders, even when a process has root privileges.
This is a key difference from older administrator assumptions. If a path is protected by the platform, the right answer is not usually “try harder with sudo.” The right answer is to use the supported management mechanism or place your files in the correct admin-writable location.
You can check SIP state from the running OS.
csrutil statusOn a standard managed Mac, expect to see that System Integrity Protection is enabled. SIP can only be modified from macOS Recovery. It cannot be disabled by a normal running process, even one using sudo.
Practical admin-created content normally belongs in places such as:
/Library/Application Support
/Library/Preferences
/Library/LaunchDaemons
/Library/LaunchAgents
/usr/localThere is an important nuance in that list. /usr is SIP-protected as a whole, but /usr/local is an explicit exception intended for third-party and administrator-managed tools. Put admin-installed command-line tools in /usr/local/bin, not /usr/bin or /usr/sbin.
Avoid using /System as an admin workspace.
The dangerous commands
These patterns are common in emergency troubleshooting and dangerous in production.
sudo chmod -R 777 /some/path
sudo chown -R root:wheel /some/pathThe first grants broad write access. The second can break application ownership, user data access, package receipts, or management agent behavior. Recursive commands are not automatically wrong, but they require a narrowly scoped path and a tested rollback plan.
Safer pattern:
# Inspect first.
ls -leO@ /path/to/item
stat -f "%Sp %Su %Sg %N" /path/to/item
# Change one item or one controlled directory after confirming scope.
chmod u+rw /path/to/itemThe ls -leO@ pattern is dense but useful: -e shows ACLs, -O shows BSD file flags, and -@ shows extended attributes. Extended attributes are metadata attached to a file outside the normal file content, and they can affect macOS behavior in ways a simple POSIX mode string will not reveal.
The operating rule
On macOS, permissions work starts with context: user, group, mode bits, ACLs, elevation, and platform protections.
Do not translate Windows administration as “take ownership and force permissions.” Translate the goal. Inspect first, change the smallest possible scope, use sudo only when needed, and respect SIP-protected operating system paths.