macos-smb-server
Skill3 starsChanged 2 months agoMITView on GitHub
Configure macOS's built-in SMB server (com.apple.smb.server) — settings apply only when committed via SCPreferences, never via defaults write. Use when a Mac's "Macintosh HD" or a home folder is visible to other machines on the LAN (virtual shares), when disabling guest access on file shares, when a com.apple.smb.server change doesn't take effect, or when proving server-side which shares a Mac offers.
In this repository28 other files it gives its agents.
- affix-domainsSkill
- apple-designSkill
- asus-esc8000-firmware-upgradeSkill
- asus-esc8000-gpu-bios-tuningSkill
- build-stealth-rustdeskSkill
- chrome-cdp-setupSkill
- cua-macos-lume-sandboxSkill
- deploy-kimi-k26-on-rtx-pro-6000Skill
- deploy-kimi-k3-on-rtx-pro-6000Skill
- deploy-stealth-rustdeskSkill
- ghostty-terminfoSkill
- herdr-rename-hookSkill
- llm-inference-benchmarkSkill
- lxd-docker-firewall-conflictSkill
- mac-mini-as-headless-serverSkill
- macos-dual-instanceSkill
- mac-smb-automountSkill
- openclaw-diagnoseSkill
- paseo-profilesSkill
- private-fork-syncSkill
- refresh-claude-accountSkill
- ssh-claude-authSkill
- sync-claude-accountsSkill
- to-featuresSkill
- trusted-publishSkill
- ubuntu-lxd-gpu-serverSkill
- ubuntu-nvidia-gpu-enablementSkill
- ubuntu-zfs-mirror-installSkill
The file
Files
macOS SMB server (com.apple.smb.server)
Validated on macOS 26 (Darwin 25.6), Mac mini M2, 2026-08. Two facts drive everything here:
- Virtual shares: beyond the explicit sharepoints, smbd automatically offers every mounted
volume to admin users ("Macintosh HD", external drives) and each authenticating user's own home
folder. They never appear in System Settings or
sharing -l, so they can't be removed there. - Commit, don't write: smbd never reads
/Library/Preferences/SystemConfiguration/com.apple.smb.server.plistoff disk. Adefaults writethere is invisible until reboot. Changes apply only when committed through the SCPreferences API, whose commit fires thecom.apple.smb.preferenceslaunchd event that runs/usr/libexec/smb-sync-preferences.
1 — Classify what clients see
sharing -l lists the explicit sharepoints and their per-share guest flags. Anything a client
sees beyond that list is a virtual share. Done when every share visible from a client is
classified as sharepoint or virtual — the two are fixed by different mechanisms.
2 — Change settings
Sharepoints use the sharing tool directly, effective immediately: sudo sharing -r <name>
removes one, sudo sharing -e <name> -g 000 turns off its guest access, -a <path> adds one.
Server-level keys go through an SCPreferences commit, then a restart:
sudo swift scripts/smb-prefs.swift VirtualAdminShares=false VirtualHomeShares=false AllowGuestAccess=false
sudo launchctl kickstart -k system/com.apple.smbd| Key | Effect |
VirtualAdminShares | every mounted volume offered to admin users |
VirtualHomeShares | each user's home folder offered to that user |
AllowGuestAccess | global guest switch (per-share guest flags still apply) |
NetBIOSName, ServerDescription | identity shown to the network |
Values: Key=true|false|delete|<string>. Revert is the same commit with true. Without Swift
(no CLT), sudo defaults write on the plist plus a reboot also applies — the sync helper is
RunAtLoad. For keys beyond this table, ground truth is strings /usr/sbin/smbd and
strings /usr/libexec/smb-sync-preferences.
3 — Verify server-side, then client-side
The kickstart drops live sessions; clients auto-reconnect within seconds and re-request the trees they had mounted, so the server's own log is the proof:
log show --last 2m --predicate 'process == "smbd"' --infoconnect_to_named_tree status: 0xc00000cc (STATUS_BAD_NETWORK_NAME) means the requested share is
no longer offered. Done server-side when each removed share is refused or absent from the log.
Clients lie: Finder resumes stale sessions and cached listings across smbd restarts. Have the client eject its mounts (or Disconnect), reconnect, and confirm the fresh listing shows only the intended sharepoints — that confirmation completes the task.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

