Turn Off SMB File Sharing
Stop the smbd daemon so this Mac stops offering file sharing over the network.
01Command
$ sudo launchctl disable system/com.apple.smbd && sudo launchctl bootout system/com.apple.smbd02What it does
File sharing is off by default, but it is often switched on years ago and forgotten — smbd then listens on the network wherever the Mac goes, from cafes to shared offices. Disabling the daemon removes that listening port; System Settings > General > Sharing > File Sharing is the GUI equivalent. The undo commands re-enable and start it again.
03Risk
04Undo
$ sudo launchctl enable system/com.apple.smbd && sudo launchctl kickstart -k system/com.apple.smbd05Sources
- launchctl — manage launch daemons and agents (macOS man page)Evidence: Documents disable/bootout of system services such as com.apple.smbd, the SMB file-sharing daemon.
Last verified: 2026-09-18 · Category: Security & Privacy
06Related solutions
Build an AES-256 encrypted .dmg vault from the Terminal — no Disk Utility clicking required.
Check whether an application bundle was signed properly and hasn't been modified since.
The modern launchctl interface — full state of any launchd job plus a restart that actually works.