Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save henrik242/65d26a7deca30bdb9828e183809690bd to your computer and use it in GitHub Desktop.
Save henrik242/65d26a7deca30bdb9828e183809690bd to your computer and use it in GitHub Desktop.
@Gorus23
Copy link

Gorus23 commented Aug 10, 2023

thanks @gwshaw for the edits!
Here is how you can bypass MDM completely ...
Boot to Recovery
Open Terminal and enable the root user and give it a password:
Enter the command below and press Enter
dscl -f /Volumes/Macintosh\ HD\ -\ Data/private/var/db/dslocal/nodes/Default localhost -passwd /Local/Default/Users/root
There might be a slight directory difference between Intel/Silicon. If the command above does not work try using one of these variations:
/Volumes/Macintosh\ HD\ -\ Data/ or /Volumes/Data/
Enter a new password for root user. Note * If you choose a simple password be aware that the root user will be available as a user that can log into macOS which could present a risk to the security of the device.
Once complete click the Apple logo -> Reboot or in Terminal type Reboot then press Enter and let macOS start-up.
Show the hidden menubar and go to System Settings when the Setup Assistant begins by pressing Command + Option + Control + T together.
Click the Apple logo > System Settings -> Users & Groups
Create an admin user with your username and password then click Add Account. The authentication window will appear and autofill the username as user "System Setup". Change this to "root" and use the password you created earlier in Terminal.
Use the Apple menu and select Reboot and if this does not work, force off your Mac by holding the power button down at least 10 seconds.
Boot to Recovery again.
Open Terminal and enter the command below and press Enter.
touch /Volumes/Macintosh\ HD\ -\ Data/private/var/db/.AppleSetupDone
Then type Reboot and press Enter or force off your Mac again using the steps above.
If you found this helpful please donate! https://pay.siliconbypass.com

This method worked for me with a few tweaks. M2 running Ventura 13.4.1 For whatever reason, I was unsuccessful in changing the root password. Ended up creating a new user via command line and using that user to create the user in system preferences.

  1. Boot to Recovery (Hold down power button on M2.
  2. Open Terminal and create a new user using the below commands. Note that the volume name may vary. This example creates an admin user called "test"
dscl -f /Volumes/Macintosh\ HD\ -\ Data/private/var/db/dslocal/nodes/Default localhost -create /Local/Default/Users/test
dscl -f /Volumes/Macintosh\ HD\ -\ Data/private/var/db/dslocal/nodes/Default localhost -create /Local/Default/Users/test UserShell /bin/bash
dscl -f /Volumes/Macintosh\ HD\ -\ Data/private/var/db/dslocal/nodes/Default localhost -create /Local/Default/Users/test RealName "Lucius Q. User"
dscl -f /Volumes/Macintosh\ HD\ -\ Data/private/var/db/dslocal/nodes/Default localhost -create /Local/Default/Users/test UniqueID "1010"
dscl -f /Volumes/Macintosh\ HD\ -\ Data/private/var/db/dslocal/nodes/Default localhost -create /Local/Default/Users/test PrimaryGroupID 80
dscl -f /Volumes/Macintosh\ HD\ -\ Data/private/var/db/dslocal/nodes/Default localhost -create /Local/Default/Users/test NFSHomeDirectory /Users/luser
dscl -f /Volumes/Macintosh\ HD\ -\ Data/private/var/db/dslocal/nodes/Default localhost -append  /Local/Default//Groups/admin GroupMembership test
dscl -f /Volumes/Macintosh\ HD\ -\ Data/private/var/db/dslocal/nodes/Default localhost -passwd /Local/Default/Users/test
  1. Enter a new password for the user.
  2. Once complete click the Apple logo -> Reboot or in Terminal type Reboot then press Enter and let macOS start-up.
  3. Show the hidden menubar and go to System Settings when the Setup Assistant begins by pressing Command + Option + Control + T together.
  4. Click the Apple logo > System Settings -> Users & Groups
  5. Create an admin user with your username and password then click Add Account. The authentication window will appear and autofill the username as user "System Setup". Change this to "test" and use the password you created earlier in Terminal.
  6. Use the Apple menu and select Reboot and if this does not work, force off your Mac by holding the power button down at least 10 seconds.
  7. Boot to Recovery again.
  8. Open Terminal and enter the command below and press Enter.
    touch /Volumes/Macintosh\ HD\ -\ Data/private/var/db/.AppleSetupDone
  9. Then type Reboot and press Enter or force off your Mac again using the steps above.
  10. Enjoy your stolen laptop jk

A 1000 THANKS!!! So is this permanent solution or i need to do it every time i update, reinstall or format ssd?

@matheusvelosotech
Copy link

in this case I can update it well and it doesn't pull anything but, for security, I would do it from scratch so I don't have a problem. when updated and updates the system well and does not pull the mdm

@Pedro147
Copy link

I was sure I posted a question here a few days ago, but it doesn't seem to be here which is totally weird. Anyway, I have an M1 Macbook Air being used by the person that I sold it to, with no issues for three months. Then he started having trouble with the touchID so he did a macOS update and suddenly it popped up a lock which appears to be an MDM lock. I checked the machine status on SickW website and it has no iCloud lock but does indeed have an MDM lock (see here) If I hold the start button until I canget into recovery it just comes back to the lock screen. Any help appreciated please.
lock 1
Screen Shot 2023-08-12 at 11 11 51 pm

@joshworksit
Copy link

joshworksit commented Aug 12, 2023 via email

@Pedro147
Copy link

That is the bios or EFI Lock Screen. It is not set by DEP and is a feature of the bios separately.

Thanks, yes it certainly looks like an EFI lock doesn't it, but as you can see from the screenshot of the lockscreen it mentions an "organisation" It must be an EFI lock set by that company, but it perplexes me that the other attached screenshot showing the status of the machine on sickw site (which must come via some backdoor from Apples servers?) distinctly says that the machine has an MDM lock. Very weird and annoying.

@joshworksit
Copy link

joshworksit commented Aug 12, 2023 via email

@Pedro147
Copy link

It looks like Apple Silicon does not have that screen you are showing which is weird…but MDM can set that feature after all it seems.   All is in the link ….

sorry, what link are you referring to please?

@joshworksit
Copy link

joshworksit commented Aug 12, 2023 via email

@Pedro147
Copy link

You lost me I asked about a link, but thanks for your thoughts anyway

@ehsan58
Copy link

ehsan58 commented Aug 13, 2023

@joshworksit
Copy link

Good lord if I had known my email replies were posting like that…garrrrr….

@Pedro147
Copy link

Thanks guys

@Ran-Xing
Copy link

Ran-Xing commented Aug 16, 2023

@Pedro147 May I ask which url you used to query this picture?

@Pedro147
Copy link

@Ran-Xing
Copy link

@Pedro147 I'm talking about the content of this picture

MDM_LOCAL: on

@Pedro147
Copy link

You mean to query the info in the picture, so https://sickw.com/?page=services&service=11

@Ran-Xing
Copy link

Ran-Xing commented Aug 16, 2023 via email

@GeorgeDuke1971
Copy link

general question on stopping DEP reminders in macOS Ventura
Hello, I have found this thread helpful in stopping DEP reminders in Monterey, and just received a Mac Studio (still in the box) from Apple and was hoping that you could recommend preventing DEP reminders. My institution puts a lot of rather invasive software on Macs including blocking naming of the computer and blocking the root user. Thanks!

@RickyGoodlett
Copy link

I did not quite understand. Why is this necessary? Explain someone briefly

@wangyv6
Copy link

wangyv6 commented Aug 20, 2023

pretty cool, how can i make sure the mdm enrollment prompt is fully closed ? need some time to confirm ?

@wangyv6
Copy link

wangyv6 commented Aug 20, 2023

👍😍😍

@hdsheena
Copy link

hdsheena commented Aug 24, 2023

@sonomadep looks like those files don't exist actually..

Mine were located in /Volumes/Macintosh\ HD\ -\ Data/private/var.. in case it helps anyone else

@grzesiolpl
Copy link

grzesiolpl commented Aug 26, 2023

@sonomadep looks like those files don't exist actually..

Mine were located in /Volumes/Macintosh\ HD\ -\ Data/private/var.. in case it helps anyone else

Hmm… My MCP i5 lets me install Catalina, but anything higher shows greyish SSD and info "This disk is locked". Root user is working normally, but the disk has some way of security in higher versions of macOS.

edit: I will check if I have proper Secure Boot options enabled and let u know if that solved the problem.

@opsquid
Copy link

opsquid commented Aug 27, 2023

Awesome! It work for me, now the nagging DEP popup won't show anymore. Thank you.

@Solmonz
Copy link

Solmonz commented Aug 28, 2023

May I ask how to bypass MDM and update the system normally on the new version of macOS 14 (Sonoma)?

@grzesiolpl
Copy link

May I ask how to bypass MDM and update the system normally on the new version of macOS 14 (Sonoma)?

Disable annoying Remote Management Pop-Up after upgrading to macOS Sonoma (14)
Apple further added a new gate preventing people from using their DEP-enabled Macs without installing the profiles in macOS Sonoma. After upgrading from a fully-working Ventura copy (with MDM servers blocked in hosts) to macOS Sonoma DP 1, your Mac will want to give you a pop-up window every 10 mins reminding you to install a DEP profile. Did some experiments and I think Apple is secretly pinging their MDM servers no matter you have an active profile associated w/ SN or not. As long as the servers are not reachable they will annoy you with their new pop-up system.

The Workaround

(1) Disable SIP in 1 True Recovery

(2)
sudo rm /var/db/ConfigurationProfiles/Settings/.cloudConfigHasActivationRecord

sudo rm /var/db/ConfigurationProfiles/Settings/.cloudConfigRecordFound

sudo touch /var/db/ConfigurationProfiles/Settings/.cloudConfigProfileInstalled

sudo touch /var/db/ConfigurationProfiles/Settings/.cloudConfigRecordNotFound

(3) you're all set. enjoy this boring upgrade

@Solmonz
Copy link

Solmonz commented Aug 28, 2023

May I ask how to bypass MDM and update the system normally on the new version of macOS 14 (Sonoma)?

Disable annoying Remote Management Pop-Up after upgrading to macOS Sonoma (14) Apple further added a new gate preventing people from using their DEP-enabled Macs without installing the profiles in macOS Sonoma. After upgrading from a fully-working Ventura copy (with MDM servers blocked in hosts) to macOS Sonoma DP 1, your Mac will want to give you a pop-up window every 10 mins reminding you to install a DEP profile. Did some experiments and I think Apple is secretly pinging their MDM servers no matter you have an active profile associated w/ SN or not. As long as the servers are not reachable they will annoy you with their new pop-up system.

The Workaround

(1) Disable SIP in 1 True Recovery

(2) sudo rm /var/db/ConfigurationProfiles/Settings/.cloudConfigHasActivationRecord

sudo rm /var/db/ConfigurationProfiles/Settings/.cloudConfigRecordFound

sudo touch /var/db/ConfigurationProfiles/Settings/.cloudConfigProfileInstalled

sudo touch /var/db/ConfigurationProfiles/Settings/.cloudConfigRecordNotFound

(3) you're all set. enjoy this boring upgrade
I am currently on macOS 12, and I want to reinstall, disable MDM, and then upgrade to the newer version. How should I proceed? I've been trying to figure this out for a while
How to disable SIP

@ehsan58
Copy link

ehsan58 commented Aug 29, 2023

May I ask how to bypass MDM and update the system normally on the new version of macOS 14 (Sonoma)?

Disable annoying Remote Management Pop-Up after upgrading to macOS Sonoma (14) Apple further added a new gate preventing people from using their DEP-enabled Macs without installing the profiles in macOS Sonoma. After upgrading from a fully-working Ventura copy (with MDM servers blocked in hosts) to macOS Sonoma DP 1, your Mac will want to give you a pop-up window every 10 mins reminding you to install a DEP profile. Did some experiments and I think Apple is secretly pinging their MDM servers no matter you have an active profile associated w/ SN or not. As long as the servers are not reachable they will annoy you with their new pop-up system.
The Workaround
(1) Disable SIP in 1 True Recovery
(2) sudo rm /var/db/ConfigurationProfiles/Settings/.cloudConfigHasActivationRecord
sudo rm /var/db/ConfigurationProfiles/Settings/.cloudConfigRecordFound
sudo touch /var/db/ConfigurationProfiles/Settings/.cloudConfigProfileInstalled
sudo touch /var/db/ConfigurationProfiles/Settings/.cloudConfigRecordNotFound
(3) you're all set. enjoy this boring upgrade
I am currently on macOS 12, and I want to reinstall, disable MDM, and then upgrade to the newer version. How should I proceed? I've been trying to figure this out for a while
How to disable SIP

Disable System Integrity Protection Temporarily

To disable SIP, do the following:

Restart your computer in [Recovery mode] (https://support.apple.com/en-us/HT201314).

Launch Terminal from the Utilities menu.

Run the command csrutil disable.

Restart your computer.

@N4ssim
Copy link

N4ssim commented Aug 29, 2023

Hello, is it a good choice to buy a MacBook MDM for the next two years?

What should I check when buying a MacBook MDM?

I've already had a MacBook pro 2020 M1 MDM, but now I'm hesitating between a MacBook Pro 2021 M1 Pro 16/512 No MDM and a MacBook Pro 2021 M1 Pro 32/1T MDM for same price.

@iclumsy
Copy link

iclumsy commented Aug 31, 2023

Where can I buy a MDM macbook for a good price?

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