Personal tools
Navigation
Log in


Forgot your password?
New user?
 
Document Actions

How-To: Reset a User's Password Without an Install Disk

Folks,

You're stuck — you're over at your aunt's house for Thanksgiving, and your uncle comes to you and says, "you work with computers, maybe you can you help me out with this computer problem I've been having." As you stifle a groan at doing work on a stomach full of turkey when you'd rather be watching the football game, he shows you his iMac. He has forgotten his password, misplaced his install disks, doesn't have a separate admin account, and can't log in to the computer. Of course, since it's a holiday you don't have your usual toolkit with you. How can you get out of this bind? The trick is to use the command line tool nicl in raw mode from single user boot.

WARNING: AS ALWAYS, BE VERY, VERY CAREFUL WITH YOUR TYPING ON THE COMMAND LINE. MISSING A SPACE OR A PERIOD CAN HAVE SERIOUS CONSEQUENCES.

Each step below has a single command that should be typed on one line without hitting return, even if the e-mail system breaks it up into multiple lines.

  1. Boot into single user mode by holding down the command and S keys at startup time.
  2. Check the disk drive by using the fsck command line tool once the command prompt has shown up.
  3. /sbin/fsck -fy
  4. After the check finishes, mount the disk drive so that you can make changes to it by using the mount command line tool.
  5. /sbin/mount -uw /
  6. Find the user's short name, if you don't already know it by using nicl.
  7. /usr/bin/nicl -raw /var/db/netinfo/local.nidb -list /users

    This will list all of the users on the system, showing their short names.

  8. Use nicl to delete the authentication authority for the user. Substitute the user's short name for "username" in the command line below.
  9. /usr/bin/nicl -raw /var/db/netinfo/local.nidb -delete /users/username authentication_authority

    This converts the user to a crypt hash user, which can have a conveniently empty password.

  10. Give the user an empty password. Again, substitute the user's short name for "username" in the command line below.
  11. /usr/bin/nicl -raw /var/db/netinfo/local.nidb -create /users/username passwd
  12. Reboot the computer.
  13. /sbin/reboot

The user now has an empty password crypt hash, and you can log in and reset the user's password using the Accounts preference pane. Have a happy Thanksgiving!


--Paul



Powered by Plone, the Open Source Content Management System