-
Shut down your computer, and turn it on again. Hold
⌘+S
while it is booting. -
Mount the partition as read/write by running this command:
sudo mount -uw /
- When the console is done loading, run the command:
sudo visudo
- Press the letter
i
once. Scroll to the bottom of the file. Enter in the following, replacingusername
with your username:
username ALL=(ALL) NOPASSWD: ALL
- Press the escape key. Type in
:wq
and press enter. Run the command below to reboot the computer now. Do not hold⌘+S
this time:
sudo reboot
- Log in, and open Terminal. Run the command below, replacing
username
with your username:
sudo dscl . -merge /Groups/admin GroupMembership username
- Reboot the computer once more, for good measure:
sudo reboot
- Congratulations. You are now root.