How to disable the Guest account in macOS Mojave using `dscl`? 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.
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. 


Enable Guest User in 10.14.x Via the Command Line (without a MDM)?