← ClaudeAtlas

mac-smb-automountlisted

Auto-mount another Mac's SMB shares on macOS at login and keep them mounted (LaunchAgent + NetFS), over Tailscale or LAN, authenticating with the shared Apple ID (Kerberos LKDC) so no password is stored. Use when mounting a Mac's shares automatically; when an SMB connection to a Mac prompts for a password or returns "Authentication error" despite the right password; when a mount agent keeps declaring healthy mounts stale; or when replacing local Dropbox/Google Drive sync clients with mounts of the server's copies.
soulmachine/skills · ★ 3 · AI & Automation · score 76
Install: claude install-skill soulmachine/skills
# Auto-mount a Mac's SMB shares Deploys `scripts/mount-smb-shares.sh` behind a LaunchAgent on the **client** Mac so the **server** Mac's shares sit at `/Volumes/<share>` after login and come back by themselves after sleep, network changes and server hiccups. Triggers: login, every 300 s, `/var/run/resolv.conf` changes, and every power-state change (`com.apple.powermanagement.systempowerstate`, the same event Time Machine's helper wakes on) so a wake from sleep remounts within seconds instead of waiting for the interval — which launchd stretches well past 5 min on battery. The script exits at once when the lid is closed, so dark wakes cost nothing. Both Macs signed into the same Apple ID is the normal case, and then no password exists anywhere in the setup. ## Facts every step rests on - **Mounts happen at login, not boot.** NetFS needs the Aqua session (and, with FileVault, the unlocked login keychain), so the agent lives in `gui/<uid>`. A LaunchDaemon would mount as root, outside the user's namespace. With auto-login on and FileVault off, login follows boot unattended. - **One hostname.** Address the server by its Tailscale MagicDNS name only. Tailscale takes the direct LAN path at home, so the same name works away with no switching logic. - **NetFS, not `mount_smbfs`.** `/Volumes` is not user-writable; `osascript -e 'mount volume "smb://…"'` mounts there through the privileged agent and shows in Finder. It blocks **forever** when the server cannot authenticate the client