MacOS – Might have accidentally change admin user to standard user

macos

So I tried deleting an app a few days ago and it requires admin name and password. I tried every single combination that i can think of and it wouldnt work. I then realize that I have a standard user instead of an admin. I tried the create a new admin user way but the permission is denied.
I got no idea how to proceed onwards. Help needed please.
Its a osx yosemite 10.10.5

Best Answer

To create a new admin user, you need to reboot into Single User mode once:

  • Boot to single user mode (⌘-S while powering on)
  • Run /sbin/fsck -fy
  • Run /sbin/mount -uw /
  • Run rm /var/db/.AppleSetupDone
  • Run reboot

After the reboot, the Setup Assistant should get displayed again (as for a new Mac) and prompt you to create a new user. This user will automatically have admin rights.