kmosx: I lost my admin user (Mac OS X 10.4 and earlier)

Last modified: Mar 12, 2021 4:55 PM
0 633 Last modified Mar 12, 2021 4:55 PM
Disclaimer: Apple does not necessarily endorse any suggestions, solutions, or third-party software products that may be mentioned in the topic below. Apple encourages you to first seek a solution at Apple Support. The following links are provided as is, with no guarantee of the effectiveness or reliability of the information. Apple does not guarantee that these links will be maintained or functional at any given time. Use the information below at your own discretion.


I lost my admin user (Mac OS X 10.4 and earlier)

If you are unfortunate enough to delete your only admin user, or remove his admin capability, then as long as you have another user with login capability, you can give that user admin rights as shown below. You can then re-create the original user or reinstate the admin capability using NetInfo Manager.

Print this post out in a mono-spaced font, and type carefully, paying attention to spaces and punctuation, since you cannot copy/paste in Single User mode.

Caution: in single user mode you have root privileges. Be careful! Substitute the name of 'youruser' below.

Boot into single user mode (Command-S) at startup which will eventually get you a shell prompt (ending in #). Then type the following:

fsck -fy


Repeat the above until it says your disk is OK. Then continue with

mount -uw /
nicl -raw /var/db/netinfo/local.nidb -merge /groups/admin users youruser


If you get a message saying "invalid path", then type these two commands first:

nicl -raw /var/db/netinfo/local.nidb -create /groups/admin gid 80
nicl -raw /var/db/netinfo/local.nidb -create /groups/admin passwd '*'


and then repeat the "nicl ... -merge" command. Then:

reboot


You will now be able to login as 'youruser' and have administrative privileges.

Membership of the 'admin' group is the only thing that distinguishes administrative users from ordinary users.

Do you want to provide feedback on this User Contributed Tip or contribute your own? If you have achieved Level 2 status, visit the User Tips Library Contributions forum for more information.
Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.