DirectNET

Data Center Management Solutions including UPS Systems, Data Center Cooling, KVM over IP & IP Power Strips, Server Racks and Server Rack accessories; KVM Switches and KVM Extenders; Rackmount Monitors and Rackmount Keyboards.


NAVIGATION
Home
Store
INSIDE MAC
Television Shows
Broadcast Shows
Daily News Shows
Special Shows
EVENTS
DAILY TIPS
Design
Mac OS X
Mac OS X UNIX
COMMUNITY
Surveys
NEWS
Current
Press
Archive
FEATURES
Editorial
Dr. Mac
Reviews
Reader Reports
RESOURCES
FAQ
Documentation
Learning Center
MAN pages
Glossary
Tutorials
Tips
Links

OUR PARTNERS

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

Copyright © 2000-2010 Inside Mac Media, Inc. All rights reserved.
Apple assumes no responsibility with regard to the selection, performance, or use of the products or services. All understandings, agreements, or warranties, if any, take place directly between the vendors and prospective users.
Apple, the Apple logo, Mac, PowerMac G4, PowerMac G5, Xserve, Xserve RAID, PowerBook, iBook, Airport, AirPort Extreme, iMac, eMac, iLife, iMovie, iCal, iPhoto, iTunes, QuickTime, FireWire, iPod, iSight, AppleWorks, Macintosh, Jaguar, Panther, Mac OS, Mac OS X and Mac OS X Server are trademarks of Apple Computer, Inc.