OSXFAQ Mac OS X Tip-of-the-Day 
Trouble-Shooting IV (Advanced) - Restore a Lost Admin
By Adrian Mayo - Editor - OSXFAQ
Some users have found themselves without admin permissions, either due
to a system crash, messing about with NetInfo, or because an admin user
cannot log in (but a normal user can). The problem is that one needs
an Admin user in the first place to add admin status to another user.
A preventative solution is to always have a spare admin user than can
be used in such situations.
Otherwise, it is possible to add admin status in single user mode.
Boot with the Command (Apple) and S keys pressed to enter single user
mode. (Note that if your Mac has its firmware password protected, you
may not be able to boot into single user mode. See:
http://www.apple.com/downloads/macosx/apple/openfirmwarepassword.html )
At the resulting text screen type:
mount -uw /
nicl -raw /var/db/netinfo/local.nidb -merge /groups/admin users your-username-here
reboot
'your-username-here' should be the short user name, not the full name.
Use Remote Login. If you cannot login, or your machine appears to
freeze (the machine is OK but the GUI has frozen), connect to your
machine from another machine using Remote Login.
Enable Remote Login on your machine from System Preferences, pane
Sharing, tab Services, and check 'Remote Login'. (Obviously, this is
something you enable in anticipation of a problem, as once the problem
occurs your probably can't get to System Preferences.)
Connect to your machine from the other machine using the Terminal, and
launch 'ssh':
ssh -l short-user-name ip-address/hostname
Eg:
ssh -l loraine 217.155.168.149
or
ssh -l loraine carcharoth
For example, if your machine appears to freeze you can kill the GUI and
the frozen login from the other machine by logging in with ssh as above
and issuing the commands:
ps axc | grep loginwindow
502 ?? Ss 0:03.61 loginwindow
sudo kill -KILL 502
Substitute '502' for whatever number you see.
WARNING: this will force-quite the entire login and the logged-in user
will loose all unsaved changes.
Enjoy !! :-)
Panther 10.3.8
To discuss this tip in the OSXFAQ Mac OS X Tip-of-the-Day Forum, click here:
http://forums.osxfaq.com/viewforum.php?f=100
E-mail your comments or suggestions to webmaster@osxfaq.com
|