We've all been in this situation before: we are on a friend's (or work) computer and need to configure something or install some little program, but can't because we don't have the administrative rights. Well, if you're on a Mac, instead of trying to crack the password -- or smashing it into a million pieces -- you can use this nifty little hack to add yourself as an admin.
Jason Striegel over at the MAKE: Blog has posted an excellent tutorial on how to "Gain admin rights in OS X Leopard." How is it done? Well, according to Jason:
To add yourself to the admin group, you'll need to reboot into single user mode and run a couple commands. Here's how:
First, boot the machine and hold down Command-S until it boots into single user mode. Then, mount the hard disk in read-write mode (and check it for errors) with the following two commands:
/sbin/fsck -fy
/sbin/mount -uw /
We'll be using the dscl command to add your username to the admin group, but first you need to start directory services or it will return an error:
launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist
To list the users in the admin group, use the following dscl command:
dscl . read groups/admin users
You won't see your username, of course, because you aren't an admin. To add yourself, run the following:
dscl . append groups/admin users yourusername
You can double check that your username 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 permission to install apps or change any system settings.
Awesome tip Jason! To check out the original write-up click here.
Subscribe to The Daily Hack's full RSS site feed













Here’s the way to add a user to the admin group using dscl, which is recommended going forward, replacing niutil:
Adding a user:
dscl . append /Groups/admin GroupMembership gneagle
Removing a user:
dscl . delete /Groups/admin GroupMembership gneagle
Reading the membership of the admin group:
dscl . read /Groups/admin GroupMembership
Presumably this will work OK with Leopard. We’ll see…