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

gboy13 commented Jul 6, 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

@nitin88
Copy link

nitin88 commented Jul 6, 2023

Hi,

is it possible to override specific MDM profile configuration?

one of the profile configuration disables the shared internet by MDM. I want to override that or prevent MDM to override that configuration somehow. I have full permissions to boot into recovery mode to alter any system level changes, but dont want to opt out of MDM

@Ran-Xing
Copy link

Ran-Xing commented Jul 8, 2023

@gboy13

The correct one should be this, it doesn't need \ -\ Data

++dscl -f /Volumes/Macintosh\ HD/private/var/db/dslocal/nodes/Default localhost -passwd /Local/Default/Users/root
--dscl -f /Volumes/Macintosh\ HD\ -\ Data/private/var/db/dslocal/nodes/Default localhost -passwd /Local/Default/Users/root

@msarmadahsan
Copy link

@gboy13
@Ran-Xing

Thanks a lot! This works perfectly!

@gboy13
Copy link

gboy13 commented Jul 9, 2023

@Ran-Xing

The root user with my M2 and Ventura did not work with either way. That's why I had to create the new admin user. YMMV.

FYI if your drive name is different than the default, then you will have to change it either way in all commands.

@josepyrex
Copy link

@khan-belal
@boolias

Hey all, I followed all the steps and got the Mac up and running and everything went through smoothly. Currently running Mojave and I tried commenting out the gdmf.apple.com code on the Host file which got the Ventura update to show up. However, whenever I try installing it, whether it'd be through the System Preferences UI or the Terminal, I get this error "The Request Timed Out." and "Error downloading updates."

Any idea how to solve it and if you managed to get around it?

@mikevic18
Copy link

You can just download the update through the App Store.

@wchadm
Copy link

wchadm commented Jul 14, 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

Thank you for this - worked perfectly on 2023 M2 MBA 15"!

@samcoinhope
Copy link

I cant creat a root user in my ventura 13.4.1
Please help , it gives me error in the terminal ??

@joshworksit
Copy link

joshworksit commented Jul 15, 2023 via email

@samcoinhope
Copy link

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

Thank you for this - worked perfectly on 2023 M2 MBA 15"!

is this steps work with the new update of ventura 13.4.1 ??

@joshworksit
Copy link

joshworksit commented Jul 15, 2023 via email

@bagofcig
Copy link

bagofcig commented Jul 17, 2023

@gboy13

The correct one should be this, it doesn't need \ -\ Data

++dscl -f /Volumes/Macintosh\ HD/private/var/db/dslocal/nodes/Default localhost -passwd /Local/Default/Users/root
--dscl -f /Volumes/Macintosh\ HD\ -\ Data/private/var/db/dslocal/nodes/Default localhost -passwd /Local/Default/Users/root

Hi , i’m not able to do any command with the dscl -f in boot recovery.
I tried both commands the one with \ -/ ,,, and with out it. Please help me out
Error attached
Also, i tried the video link which you were referring but no luck passing the first one.
IMG_5201

@jeremylpro
Copy link

jeremylpro commented Jul 18, 2023

Will updating macOS change anything?

@joshworksit
Copy link

joshworksit commented Jul 18, 2023 via email

@matheusvelosotech
Copy link

@gboy13
The correct one should be this, it doesn't need \ -\ Data

++dscl -f /Volumes/Macintosh\ HD/private/var/db/dslocal/nodes/Default localhost -passwd /Local/Default/Users/root
--dscl -f /Volumes/Macintosh\ HD\ -\ Data/private/var/db/dslocal/nodes/Default localhost -passwd /Local/Default/Users/root

Hi , i’m not able to do any command with the dscl -f in boot recovery. I tried both commands the one with \ -/ ,,, and with out it. Please help me out Error attached Also, i tried the video link which you were referring but no luck passing the first one. IMG_5201

i'm with the same problema. Did u know hw to fix it? Please

@matheusvelosotech
Copy link

someone can help mwith with the erro? Please

@matheusvelosotech
Copy link

someone please

@matheusvelosotech
Copy link

image
i'm with this erro too ;c

@joshworksit
Copy link

joshworksit commented Jul 21, 2023 via email

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

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