Gain admin rights in OS X Leopard

It's happened to me more than once that I've needed to configure something on a managed Mac laptop at work for which I have no admin access. Normally you can just track down your network administrator, but if it's after hours or you are traveling, there's another option: escalate your own account privileges by adding yourself to the admin group.

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.


Recent Entries

Comments

Oldest comments listed first.

Posted by: Mike on February 13, 2009 at 7:42 AM

TUAW had a similar, shorter, slightly noisier (the first boot video) version of the same idea:

http://www.tuaw.com/2008/09/01/tuaw-tip-create-an-os-x-admin-user-without-a-disc/%20[http://www.tuaw.com/2008/09/01/tuaw-tip-create-an-os-x-admin-user-without-a-disc/

However, it should be noted that there's a typo in the terminal commands.

It should read
$ mount -uw /
$ rm /var/db/.AppleSetupDone
$ shutdown -h now


Posted by: arougthopher on February 13, 2009 at 9:03 AM

lock it down

http://users.ez-net.com/~jasonb/secureit.html

not sure if this works on the latest versions. also check here:

http://www.securemac.com/macosxsingleuser.php


Posted by: Beth on February 13, 2009 at 9:39 AM

Note....

If you have a decent sysadmin, the machine will have a firmware password set, and the machine won't allow a single-user boot. You can find out if it does have one set by booting holding down the "option" key at startup, and it will prompt for a password if there is one set.


Posted by: Charlie Flowers on February 13, 2009 at 10:18 AM

Awesome tip Jason! I featured it on The Daily Hack...keep up the great work, man. :-)

Charlie Flowers
DailyHack.net
twitter.com/charlie


Posted by: John on April 8, 2009 at 9:50 AM

Great

This worked great but people be careful to put all the spaces in where they go or else the command will not be recognized. By the way thanks for putting this up your a life saver!


Leave a comment


Subscribe to MAKE!Subscribe to MAKE Magazine!

Subscribe today, save 42% and get web access to MAKE free. MAKE Digital Edition is available only to subscribers.

$34.95 / 1 year
(4 Quarterly Issues)

Subscribe now


Void your warranty, violate a user agreement, fry a circuit, blow a fuse, poke an eye out. Make: The risk-takers, the doers, the makers of things... Welcome to Make: Online!


CRAFT Maker Shed Maker Faire MAKE television




Check out more videos from MAKE.

Maker SHED

Connect with MAKE

Be a MAKE fan on Facebook MAKE on Facebook
Visit our Facebook page and become a fan of MAKE!
MAKE on Twitter MAKE on Twitter
Follow our MAKE tweets!
MAKE Flickr Pool MAKE on Flickr
Join our MAKE Flickr Pool!
    make_tips on Twitter



    MAKE Archives

    Make: Money

    Make: Science Room
    Subscribe to MAKE Magazine!

    Make: Online editors and authors!

    Gareth BranwynGareth Branwyn
    Editor-in-Chief


    Phillip TorronePhillip Torrone
    Senior Editor
    | Web | Twitter


    Becky SternBecky Stern
    Associate Editor
    | AIM | Twitter


    Marc de VinckMarc de Vinck
    Contributing Writer
    | AIM | Twitter


    John ParkJohn Park
    Contributing Writer
    | Twitter


    Sean RaganSean Ragan
    Contributing Writer
    | Twitter


    Matt MetsMatt Mets
    Contributing Writer
    | AIM | Twitter


    Dale DoughertyDale Dougherty
    Editor & Publisher
    | Twitter


    Shawn ConnallyShawn Connally
    Managing Editor
    | Twitter


    Goli MohammadiGoli Mohammadi
    Associate Managing Editor

    Kip KayKip Kay
    Weekend Projects
    | AIM | Twitter


    Collin CunninghamCollin Cunningham
    Contributing Writer
    | AIM | Twitter

    Adam FlahertyAdam Flaherty
    Contributing Writer
    | AIM | Twitter


    John BaichtalJohn Baichtal
    Contributing Writer
    | AIM | Twitter



    More contributors: Mark Frauenfelder (Editor-in-Chief, MAKE magazine), Kipp Bradford (Technical Consultant/Writer), Chris Connors (Education), Diana Eng (Guest Author), Peter Horvath (Intern), Brian Jepson (O'Reilly Media), Robert Bruce Thompson (Science Room)

    Suggest a Site!

    Advertise here with FM.

    Why advertise on MAKE?
    Read what folks are saying about us!

    Click here to advertise on MAKE!



    Current Podcast

    itunesdl.gif Behind the Scenes at MAKE and CRAFT In January, many of the remote MAKE/CRAFT team members (myself included) convened at the Maker Media headquarters at O'Reilly Media in Sebastopol, California. Take a look behind the scenes of your favorite DIY publications as Goli Mohammadi gives us... More...

    Get the Make: Online sent via email
    Enter your email to receive Make: Online each day:



    Sign up for the Make: Newsletter

    Our Make: Newsletter covers news from maker Media, has original columns, Shed deals, and more! You can also read the archives of past issues.


     



    MAKE Fascination video series brought to you by Dow

    Make: Education
    MAKE: en EspaƱol MAKE: Japan
    Important please read


    Subscribe to MAKE Magazine!

    Recent Posts from the Craft: Blog