🚀 Bypass MDM for macOS (Up to Sequoia)
A comprehensive guide to bypass MDM and reinstall macOS on a MacBook/iMac. Follow the steps below to ensure a successful setup.
- IPSW Files: Download macOS firmware.
- Apple Configurator 2: Manage macOS installation.
Use the script below to bypass MDM automatically:
curl https://raw.githubusercontent.com/tahabarooti/bypass-mdm/refs/heads/main/mdm.sh -o bypass.sh && chmod +x ./bypass.sh && ./bypass.shEnter Recovery Mode:
Turn off the MacBook, hold the power button, and boot into Recovery Mode.Erase Disk:
Open Disk Utility, select "Macintosh HD", and erase it.Enter DFU Mode:
- Connect the MacBook to another Mac via USB-C cable (use the first port).
- Power off the MacBook.
- Press Control (L) + Option (L) + Shift (R) + Power for 10 seconds.
- Release all keys except Power and hold it for another 10 seconds.
Restore macOS:
- Open Apple Configurator 2 on the second Mac.
- Drag and drop the IPSW file into it.
- Wait ~10 minutes for installation to complete.
- The MacBook will restart into macOS.
Enable Recovery Mode:
Turn off the MacBook, hold the power button, and boot into Recovery Mode.Activate Root Account: Open Terminal and run:
dscl -f /Volumes/DiskName/private/var/db/dslocal/nodes/Default localhost -passwd /Local/Default/Users/root
Set a password for the root account.
Note: Adjust the DiskName based on the macOS installation location.
Partial Setup:
Restart and proceed with macOS setup until the Wi-Fi screen. Do not connect to Wi-Fi.Access Terminal:
Press Command + Option + Control + T to open Terminal.Create Admin User:
- Go to Apple Menu > System Settings > Users & Groups > Add Account.
- Authenticate as root.
- Create a new admin account.
Finalize Setup:
Open Terminal in Recovery Mode and run:touch /Volumes/Data/private/var/db/.AppleSetupDone
Disable Root:
After setup, disable root:dsenableroot -d
Initial Setup Without Wi-Fi.
Complete macOS setup without connecting to Wi-Fi.Block MDM Hosts: Open Terminal and run:
sudo -i echo "0.0.0.0 iprofiles.apple.com" >> /etc/hosts echo "0.0.0.0 mdmenrollment.apple.com" >> /etc/hosts echo "0.0.0.0 deviceenrollment.apple.com" >> /etc/hosts
Restart and Connect:
Reboot, connect to Wi-Fi, and use your Mac as normal.
Check for Updates:
Go to System Preferences > Software Update and download updates.Disconnect Wi-Fi:
Forget the Wi-Fi or block the MacBook's MAC address.Reboot to Install:
Reboot and install updates. Skip network connection during the setup.Reapply Host Block: After the update, verify the
hostsfile:cat /etc/hosts
If reset, block the hosts again:
echo "0.0.0.0 iprofiles.apple.com" >> /etc/hosts echo "0.0.0.0 mdmenrollment.apple.com" >> /etc/hosts echo "0.0.0.0 deviceenrollment.apple.com" >> /etc/hosts
Reconnect Wi-Fi:
Reconnect and enjoy using your Mac.
إرسال تعليق