Tuesday, February 11, 2014

Getting admin access to mac with knowing the current password

Worth repeating

Change the password in single user mode
  1. Hold ⌘S on startup
  2. mount -uw / (fsck -fy is not needed)
  3. launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist (or /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist in 10.6)
  4. dscl . passwd /Users/username (without a trailing slash) and enter a new password. You can ignore the error about com.apple.DirectoryServices.plist.
  5. reboot
Create a new admin account
  1. Hold ⌘S on startup
  2. mount -uw / (fsck -fy is not needed)
  3. rm /var/db/.AppleSetupDone
  4. reboot
  5. Go through the steps of creating a new account. You can leave all fields in the personal information step blank
  6. After logging in on the new account, go to the Users & Groups preference pane
  7. Select the old account, press the Reset Password... button, and enter a new password
Restart and enter Recovery mode (for 10.7 Lion and newer OS only)
  1. Hold ⌘R on startup
  2. Open Terminal from the Utilities menu
  3. Type resetpassword and follow the instructions