Thursday, August 14, 2014

Changing a Lost OS X Administrator Password


It happens every so often that you walk into a tech office and no one knows the password to the Macintosh OS X server or workstation that you need to use to do what you have to do.  Or let's say you just bought that Macbook at a yard sale and you get it home and the password isn't what the guy said it was... What most people don't know is that changing the administrative (or any) account password is easy-as-pie.

Back before Apple stopped putting their OS on CD/DVD, you could boot off the DVD and go into the Password Reset Utility.  You can still do this with OS X 10.9 if you happen to have it on a USB drive ready to go, but many (even us in IT) don't have those handy... you can do it without that!  


Here's how you accomplish this amazing feat of hackery...

The first thing you need to know how to do is boot into Single User Mode.  This is the key to any such operations.  To do this on any Macintosh, turn on the computer -- as soon as the screen turns that grayish white color hold down Command-S.  Hold that until the screen turns black and starts to list out the UNIX style list of things that are happening.  This will dump you at a command prompt.  The look of this prompt can vary.  But we can go from here... do not let these UNIX-style commands intimidate you.

On ALL versions of Max OS X start with these commands to check and mount the file system:


fsck -fy

mount -uw /

From here the next command(s) differ based on the version of OS X that you are working on.  Apple moved some things around over time...

For OS X v10.0-10.7.2:

passwrd username   -- where username is user that you are changing the password for.

For OS X 10.7.3 and later:

launchctl load /System/Library/LaunchDaemons/com.apple.opendirectoryd.plist
passwrd username   -- where username is user that you are changing the password for.


Don't know the username?  Hey.. it happens!  Not every Mac has admin on it -- in fact, many do not -- so there may only be one account and it might be auntjennie.  Here's how you find out what accounts are on the computer.  At the command prompt:

ls /Users

This will give you a list of all the users that are on the computer!

Using this information, you should be able to get into any Macintosh based computer running OS X without destroying any data!



~~~
Bruce has worked in educational technology for over 18 years and has implemented several 1:1/BYOD programs.  He also has been a classroom teacher for various subjects.  Bruce is the author of five books: Sands of TimeTowering Pines Volume One:Room 509The Star of ChristmasPhiladelphia Story: A Lance Carter Detective Novel and The Insider's Story: A Lance Carter Detective Novel.  Follow Bruce's Novel releases by subscribing to his FREE newsletter!

No comments:

Post a Comment