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

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

@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

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