I've attempted to disable the Guest account using dscl as follows:

sudo dscl . -append /Users/Guest AuthenticationAuthority ";DisabledUser;"

However, it doesn't seem to work, why?

I know, I can disable the Guest account from the GUI, but I like to use the CLI.

  • 1
    Do you have Find my Mac enabled? That makes the guest account compulsory, as a honey trap. – Tetsujin Aug 4 at 11:22
  • Don't think so. How can I check it? I could disable (remove from logon screen) the Guest account through System Preferences, but not through the dscl command above? – Shuzheng Aug 4 at 13:59

Here is how to disable Guest user via command line

sudo defaults write /Library/Preferences/com.apple.loginwindow GuestEnabled -bool FALSE

Note, re-enabling it is quick, but you need extra help if you need to set this up without the first GUI step or MDM.

  • Thanks, what do you mean by "set this up without the first GUI step"? Also, do you know why Guest can't be disabled using dscl? – Shuzheng Aug 5 at 18:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .