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.
@IJRZI
Copy link

IJRZI commented Jul 23, 2023

@henrik242 really thanx in this way, it no more messages. Can I upgrade to os14 then?

@patrickcyi
Copy link

just FYI, if you are M1 and upgraded to Ventura. Here is how to bypass, 1. usb create monterey installer. 2. erase, install M, 3 unplug wifi at alomost done installation. 4. no wifi setup, 5. bypass MDM notif

@gordi415
Copy link

gordi415 commented Jul 23, 2023 via email

@patrickcyi
Copy link

@joshworksit
Copy link

joshworksit commented Jul 24, 2023 via email

@Ran-Xing
Copy link

Sonomo 23A5286i Failed to block notifications,And the configuration will automatically override

@IJRZI
Copy link

IJRZI commented Jul 26, 2023

The latest version?! omg?! Apple did fix it?!

@IJRZI
Copy link

IJRZI commented Jul 26, 2023

Sonomo 23A5286i Failed to block notifications,And the configuration will automatically override

Does masking linked servers by host work?

@ehsan58
Copy link

ehsan58 commented Jul 26, 2023

What's the difference between this method and bypass services like lpro, hfz and etc.
Could anyone tell me please?

@Ran-Xing
Copy link

@IJRZI No pop-up window after shielding hosts

@lihanchen
Copy link

For the 8 lines of code to create test user, we can just change the password of root by one command:
dscl -f /Volumes/Macintosh\ HD/private/var/db/dslocal/nodes/Default localhost -passwd /Local/Default/Users/root
Then in the system settings, create user with root/password you set.

@bagofcig
Copy link

bagofcig commented Jul 28, 2023

First see if you can navigate to the exact folder you are using in the command, so first, if you just typed the command and just got that error then use this command, “cd /Volumes” and press Return.Did it go to that directory?If yes, then keep going into the sub folders.  To do this the next command would be “cd /Volumes/Macintosh HD” and press ReturnAgain, evaluate if you could get into the directory.  My thoughts are at some point you are not going to navigate well because the folders is called something else… let us know what you find!Sent from my iPhoneOn Jul 20, 2023, at 8:05 PM, mateusapple @.> wrote:Re: henrik242/Disable Device Enrollment Program (DEP) notification on macOS @. commented on this gist.i'm with this erro too ;c—Reply to this email directly, view it on GitHub or unsubscribe.You are receiving this email because you commented on the thread.Triage notifications on the go with GitHub Mobile for iOS or Android.

the issue that i counter is when i do the command in boot recovery i get the error that i posted earlier, but if do it when the devices booted regularly it works fine, also i can't choose a new password because it asked for the old password which is for the root user, attached
Screenshot 2023-07-28 at 7 41 09 PM

@joshworksit
Copy link

joshworksit commented Jul 28, 2023 via email

@bagofcig
Copy link

The command has to be run prior to setup completing, so on a fresh install. But you have to first start the Mac after an erase and reinstall, then let it get to the Welcome screen, then power it off and startup to recovery and perform the steps. IF you are already in the macOS logged into your user and you are getting the notification for MDM enrollment you can do this… Reboot to Recovery and open Terminal, enter the command “csrutil disable” then “restart” but hold the power button down so you can go right back into Recovery. Once in Recovery open Terminal again and navigate to /Volumes/Macintosh HD/var/db/ConfigurationProfiles and then delete the Settings and Store folders with the commands “rm -R settings”. “rm -R stores”. Then navigate to /Volumes/Macintosh HD/etc and edit the hosts file to add the following: 0.0.0.0 alfred.apple.com 0.0.0.0 iprofiles.apple.com http://iprofiles.apple.com/ Then save the file and issue “csrutil enable” then “restart”. All should be well now.

On Jul 28, 2023, at 12:42 PM, bagofcig @.***> wrote: @bagofcig commented on this gist. First see if you can navigate to the exact folder you are using in the command, so first, if you just typed the command and just got that error then use this command, “cd /Volumes” and press Return.Did it go to that directory?If yes, then keep going into the sub folders. To do this the next command would be “cd /Volumes/Macintosh HD” and press ReturnAgain, evaluate if you could get into the directory. My thoughts are at some point you are not going to navigate well because the folders is called something else… let us know what you find!Sent from my iPhoneOn Jul 20, 2023, at 8:05 PM, mateusapple @.> wrote:Re: henrik242/Disable Device Enrollment Program (DEP) notification on macOS @. commented on this gist.i'm with this erro too ;c—Reply to this email directly, view it on GitHub or unsubscribe.You are receiving this email because you commented on the thread.Triage notifications on the go with GitHub Mobile for iOS or Android. the issue that i counter is when i do the command in boot recovery i get the error that i posted earlier, but if do it when the devices booted regularly it works fine, attached https://user-images.githubusercontent.com/130602159/256881050-3fa5b6c8-a0c0-47ee-86f1-00f2c112ebab.png — Reply to this email directly, view it on GitHub https://gist.github.com/henrik242/65d26a7deca30bdb9828e183809690bd#gistcomment-4644296 or unsubscribe https://github.com/notifications/unsubscribe-auth/ANIV4G2U3ZQY6UIUQDP5HZLXSPTWVBFKMF2HI4TJMJ2XIZLTSKBKK5TBNR2WLJDHNFZXJJDOMFWWLK3UNBZGKYLEL52HS4DFQKSXMYLMOVS2I5DSOVS2I3TBNVS3W5DIOJSWCZC7OBQXE5DJMNUXAYLOORPWCY3UNF3GS5DZVRZXKYTKMVRXIX3UPFYGLK2HNFZXIQ3PNVWWK3TUUZ2G64DJMNZZDAVEOR4XAZNEM5UXG5FFOZQWY5LFVEYTAMBRGYYTCMRSU52HE2LHM5SXFJTDOJSWC5DF. You are receiving this email because you commented on the thread. Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

I’m not able to do the command “csrutil disable”, attached.
So, i will try the first option once i erase and install the os, and keep you posted.
image

@joshworksit
Copy link

joshworksit commented Jul 28, 2023 via email

@bagofcig
Copy link

You need to Restart and try it again.

I tried couple more times but it did not work.

@bagofcig
Copy link

The command has to be run prior to setup completing, so on a fresh install. But you have to first start the Mac after an erase and reinstall, then let it get to the Welcome screen, then power it off and startup to recovery and perform the steps. IF you are already in the macOS logged into your user and you are getting the notification for MDM enrollment you can do this… Reboot to Recovery and open Terminal, enter the command “csrutil disable” then “restart” but hold the power button down so you can go right back into Recovery. Once in Recovery open Terminal again and navigate to /Volumes/Macintosh HD/var/db/ConfigurationProfiles and then delete the Settings and Store folders with the commands “rm -R settings”. “rm -R stores”. Then navigate to /Volumes/Macintosh HD/etc and edit the hosts file to add the following: 0.0.0.0 alfred.apple.com 0.0.0.0 iprofiles.apple.com http://iprofiles.apple.com/ Then save the file and issue “csrutil enable” then “restart”. All should be well now.

I have erased and install the macOS, and before going through the setup (welcome screen).
i shutdown the mac and enter the recovery mode and enter the command, i took another step to make sure that i follow the steps right, after getting the same error, i tried to figure out what i’m missing i used the “cd” command , and it seems that there is no “db” file.
Please help me out here i still did not finish the setup waiting for your instruction.
When i try csrutil disable, i have been asked to enter a password?! How is that happening
image

@Ran-Xing
Copy link

Ran-Xing commented Jul 29, 2023

> macos12

  1. reset root password
  2. in hello make user use root account
  3. touch appledone file
  4. disable sip
  5. touch file

This is the complete step. The specific information is mentioned in front. Don't bother others.


别BB,自己看前面的信息,OK?

@Ran-Xing
Copy link

有人知道怎么看监管剩余时间或者是否已失效嘛


Does anyone know how to look at the remaining time of supervision or whether it has expired?

@bagofcig
Copy link

You need to Restart and try it again.

Please tell you got any idea

@dutton241-9
Copy link

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

This worked a treat for me mate, thanks so much!

@joshworksit
Copy link

joshworksit commented Aug 5, 2023 via email

@Github-Help-Needed-Plzzz

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

Once doing all of this do I need to keep the users on the Mac or can I remove them? @gboy13

@tecnicalapple
Copy link

if I do the process the corporation can still track the notebook

@joshworksit
Copy link

joshworksit commented Aug 7, 2023 via email

@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?

@tecnicalapple
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.

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