Disable the Guest Account on Your Mac

Remove the Guest user from the login window with a single defaults write.

macOSguest-accountdefaultssecurityMedium risk
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 false

02What 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

RiskMedium risk
RequirementsAdministrator access (sudo); log out or restart to see the change
!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 true

05Sources

  • Set up a guest user on Mac
    Apple Support · vendor-doc · 2026-09-17
    Evidence: 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