Skip to content

Instantly share code, notes, and snippets.

@jelling
Forked from volcomism/disableDEP.md
Created April 8, 2023 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jelling/6a248d07ef98ef569eb6227c3d3add35 to your computer and use it in GitHub Desktop.
Save jelling/6a248d07ef98ef569eb6227c3d3add35 to your computer and use it in GitHub Desktop.
Disable DEP lock on macOS Catalina.md

Disable DEP lock on macOS Catalina.md

  1. Boot into recovery using command-R during reboot, erase the HD using Disk Utility, and select reinstall macOS
  2. When it reboots again, be sure to press command-R to boot into recovery and continue

Procedure

  1. Open Utilities → Terminal and type
$ csrutil disable
$ reboot
  1. Hold command-R during the reboot to enter Recovery Mode again

  2. Enter Disk Utility, and mount the Macintosh HD volume (which is mounted by default but might not be /).

  3. Exit Disk Utility, open Utilities → Terminal, and type

$ cd "/Volumes/Macintosh HD/System/Library"
$ mkdir LaunchDaemons.disabled LaunchAgents.disabled
$ mv LaunchDaemons/com.apple.ManagedClient* LaunchDaemons.disabled/
$ mv LaunchAgents/com.apple.ManagedClient* LaunchAgents.disabled/
  1. Add the following line to the /Volumes/Macintosh HD/etc/hosts file
0.0.0.0 iprofiles.apple.com"
0.0.0.0 mdmenrollment.apple.com
0.0.0.0 deviceenrollment.apple.com
0.0.0.0 gdmf.apple.com
0.0.0.0 alfred.apple.com
  1. In the terminal type
$ csrutil enable
$ reboot
  1. If you come to the “Choose your country/location” dialogue, make sure to not select a wireless network, but “continue without an internet connection”

  2. After a normal boot, you can verify the DEP status in Terminal:

$ profiles status -type enrollment
Enrolled via DEP: No
MDM enrollment: No

Note If this still doesn't work, try moving the following files in Recovery mode with csrutil disabled

$ mv "/Volumes/Macintosh HD/var/db/ConfigurationProfiles"  "/Volumes/Macintosh HD/var/db/ConfigurationProfilesDisabled"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment