How to Disable Gatekeeper from Command Line in Mac OS X

May 4, 2015 - 21 Comments

Disable Gatekeeper from the command line of Mac OS X

Though most Mac users will want to keep Gatekeeper enabled for security purposes, some advanced users find that Gatekeeper is overly zealous in preventing third party apps from being used in macOS and Mac OS X.

While it’s easy to turn off Gatekeeper through the System Preferences on a Mac, another option is to disable Gatekeeper by using the command line in Mac OS. This can be helpful for scripting purposes, configuration, remote management, and just for those who prefer to use the Terminal.

Disable Gatekeeper from the Command Line in Mac OS

Launch Terminal if you haven’t done so yet (/Applications/Utilities/) and issue the following command to turn off Gatekeeper:

sudo spctl --master-disable

Hit return and enter the admin password as usually required by sudo, and Gatekeeper will instantly be disabled. If you feel like confirming this, you can do so with the –status flag and the same command, like so:

spctl --status

This will report back ‘assessments disabled’ to indicate that Gatekeeper has been turned off. You will also find that the Gatekeeper Security preference panel will be set to ‘Everywhere’.

How to Enable Gatekeeper from the Command Line of Mac OS X

Of course, you can also turn on Gatekeeper from the command line of macOS / Mac OS X too by using the following command string:

sudo spctl --master-enable

Hit return and you can confirm the status again with –status:

$ spctl --status
assessments enabled

Gatekeeper will be enabled again at it’s strictest setting. As disabling, the setting will carry through the GUI as well.

Again, most users should leave Gatekeeper turned on, and if need be, they can bypass it through the System Preference panel on a per-app basis, or by using the right-click “Open” trick.

The ability to disable Gatekeeper through Terminal has existed for quite a while now, and this tip applies to basically all modern Mac OS versions, including macOS Big Sur, Catalina, Mojave, High Sierra, and Sierra.

If you know of any other helpful tips or tricks associated with enabling and disabling Gatekeeper from the command line (or otherwise) do share them with us in the comments below.


Related articles:

Posted by: Paul Horowitz in Command Line, Mac OS, Security, Tips & Tricks


» Comments RSS Feed

  1. Gearhead says:

    In the latest Big Sur releases the man pages says the command has been modified from “master” to “global” (latest trend in politically correct coding, I guess), though the “master” version still appears to work.

    e.g. -> sudo spctl –global-disable

  2. Imran Younus says:

    I am installing VM Box 6.1.18 on OS 10.14.6 Mojave.
    I have tried this “sudo spctl –master-disable” code and in preferences had been done “anywhere” but error is remain same as the before disabling the gatekeeper, “The Installation Failed”.
    Do have any other way to install VM Box.


  3. Lisa Morrow-Mayer says:

    ive done gatekeeper and re done java, but my adobe cs5 suite is still not installed correctly. I can open the programs and use them, but on closing a crash log box opens with a report and reopen tab. I tried to update cs5 it goes to finish then says unable to update. Any ideas on how to rectify issue

  4. Valerio says:

    Hey, after I entered the code it asks me for the password, but doesn’t let me type anything. Any reason?

    • Andreas says:

      It does let you type, it just doesn’t show what you typed, to keep your password safe from anyone looking at your screen.

  5. Trish says:

    Patricias-MacBook-Air:~ MEGALI$ sudo spctl –master-disable
    -bash: sudo: command not found

    what to do?

  6. Lulu says:

    So after I type in “sudo spctl —master-disable” w/o the quotes, I hit enter and when it says password I type in my password I get a message saying “command not found”. Now what do I do??? Please help thx

  7. em says:


  8. Dhira Chakraborty says:

    Tried the command. Copy pasted in terminal and on hitting return key it shows password and next to it a key sign ( does that mean I have to disable my keychain password ??) Answers would be welcome.

    • ~ says:

      you gotta put in ur user password m8 its asking u for admin permission to turn off gatekeeper, just as it asks for ur password when u install a new program or whatever

  9. Josh Blair says:

    After I enter my password, I get an error message.

    jcblair-pc:~ jcblair$ sudo spect1 –master-disable
    sudo: spect1: command not found

    I can’t seem to find a way around this. Please help.

    • KCarb says:

      If I type “jarvis” into the command line it also says command not found, because it’s not a correct command. So I’d start by using the proper command for spctl. But if you can’t use the command line correctly than I would say this is too advanced for your technical skill level, that’s no big deal just accept and move on. I don’t go messing around with my cars engine for example, I take it to an expert. Computers are similar. Gatekeeper is there for a reason, if you can’t type syntax correctly you definitely don’t want the end result.

      • jeff schwartz says:

        He just mistyped the command, an easy mistake. Haven’t you ever mistypes a command before?

        That’s why I cut and past commands if at all possible as some can be very long and complicated. Not saying this one is long or complicated.

  10. Leonardo Iannelli says:

    This should be good in macOS Sierra, where you can no longer turn Gatekeeper off completely in System Preferences.

    • Lorne says:

      I had the same issue once the command line was inputted I went back to take a look an not it has the option of “anywhere”

  11. Andres says:

    I inserted the recommended command in terminal and I checked that Gatekeper is disabled but Sierra still can not open unsigned apps.When I click or right and open simply do nothing. What I have done wrong?

  12. Bert Visscher says:

    I found Gatekeeper disabled already. Might that be a bad sign?

    • tbn says:

      No not really, it just means you turned it off at some point, probably to get rid of the warning when opening apps from the web and third parties. Fine for advanced users, average users best to keep Gatekeeper on.

  13. redapple says:

    Now that’s finally a useful tip here…

Leave a Reply


Shop on and help support OSXDaily!

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Tips & Tricks


iPhone / iPad



Shop on Amazon to help support this site