Skip to content

Instantly share code, notes, and snippets.

@boyvanamstel
Created June 12, 2012 19:58
Show Gist options
  • Star 7 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boyvanamstel/2919778 to your computer and use it in GitHub Desktop.
Save boyvanamstel/2919778 to your computer and use it in GitHub Desktop.
Enable/Disable 'Gatekeeper' in Mac OS X Lion for testing purposes
$ sudo spctl --master-enable
$ sudo spctl --master-disable
# Read more: http://forums.appleinsider.com/t/143736/gatekeeper-is-hidden-in-os-x-10-7-3-lion-developers-can-preview-it-now
@CYLIX-LCJ
Copy link

If I type the wrong code what should I do now?
Wrong code: sudo spctl - -mater-enable
Termnail still ask me input the password then display long code. I do not know what that meaning. Termnial has been closed now what can I do now? That wrong code will affect my system or other applications? T-T

@koshatul
Copy link

Might be a bit late to the party, but I'll break the command down for you.
sudo
runs the following command as the root user (basically telling it to run the command with the highest authority), this asks for your password when you run it the first time in a terminal, it won't ask again for a little while, so you might not get any response when you run the command again.
spctl
is the tool that lets you modify the system policies, basically the OSX gatekeeper and a few other things.
--master-disable
is the parameter that disables the system policies entirely.

If you mis-typed the command and got an error it's probably not a problem, you can just retry running the command with the correct parameter.

you can always type spctl --status, if it's still enabled you'll get assessments enabled in response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment