Disable the Guest Account on Your Mac
Remove the Guest user from the login window with a single defaults write.
Run `sudo defaults write /Library/Preferences/com.apple.loginwindow GuestEnabled -bool false` to turn the Guest account off.
01Command
Command
$ sudo defaults write /Library/Preferences/com.apple.loginwindow GuestEnabled -bool false02What it does
The Guest account lets anyone use your Mac without a password — convenient for lending it out, but an open door on a laptop you carry. This command flips the same switch as System Settings > Users & Groups, and the Guest entry disappears from the login screen after you log out or restart. This differs from FileVault: it only removes the guest login option, not encryption.
03Risk
!Warning: Changing loginwindow preferences requires sudo; if the Guest user still appears, restart to refresh the login window.
04Undo
Undo
$ sudo defaults write /Library/Preferences/com.apple.loginwindow GuestEnabled -bool true05Sources
- Set up a guest user on MacEvidence: Apple's guide explains the Guest User login option and that it can be turned off in login settings; the GuestEnabled loginwindow key controls the same switch.
Last verified: 2026-09-18 · Category: Security & Privacy
06Related solutions
Change where screenshots are saved on Mac
Point macOS screen captures at any folder you choose instead of the desktop.
Show file extensions for all files on Mac
Make Finder display .pdf, .docx, .png and every other extension at all times.
Show the path bar in Finder on Mac
Permanently display the full folder path at the bottom of every Finder window.