Cain Manor

Your Guide To All Things Cain™

Gain Root Access in OS-X

First, boot the machine and hold down Command-S until it boots into sin­gle user mode. Then, mount the hard disk in read-write mode (and check it for errors) with the fol­low­ing two commands:

/sbin/fsck -fy
/sbin/mount -uw /

We’ll be using the dscl com­mand to add your user­name to the admin group, but first you need to start direc­tory ser­vices or it will return an error:

launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist</strong>

To list the users in the admin group, use the fol­low­ing dscl command:

dscl . read groups/admin users

You won’t see your user­name, of course, because you aren’t an admin. To add your­self, run the following:

dscl . append groups/admin users yourusername

You can dou­ble check that your user­name is in the list now, then type reboot to restart the machine. When you log in, you’ll see that you’re now in the admin group, with per­mis­sion to install apps or change any sys­tem settings.

From Make Mag­a­zine

Comments are closed.