Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > no more admin user

no more admin user
Thread Tools
Mac Enthusiast
Join Date: Oct 1999
Location: Boulder, CO
Status: Offline
Reply With Quote
Jan 1, 2003, 01:18 AM
 
So, here's an interesting dilemma brought to me by a friend. He is new to OS X, and decided he wanted to change his short username (later on, he admitted all he really wanted to change was his home directory name, but whatever). I didn't know of an easy way to do this, so I recommended just creating a new user and copying all of the files in his home directory into a new directory, testing it, then deleting the original user if all seemed well. Well he stumbled across NetInfo manager and figured he could just start changing stuff in there instead. Bad idea, though I must say I warned him generally about NetInfo beforehand (perhaps I shouldn't have mentioned it at all).

So now his short user name has changed, but not his home directory, and of course the system no longer recognizes him as an admin so he's kinda stuck. In fact, it recognizes no admin users on the system at all. And root is currently disabled, and with no way to authenticate in NetInfo, root cannot be enabled. Now, I'm pretty sure I remember being able to enable root using the X install disc, at least in 10.1. And we'll probably end up enabling root that way if nothing else works so he can create a new admin user and take it on as his own.

But, partially as a lesson to him and partially as a way to learn more about it myself, I'm trying to figure out if there are other ways to fix this short of reinstalling Jaguar (which is what a Mac Genius suggested to him). Essentially, are there ways to enable the root user within a shell? Is it as easy as setting the root password (root has never been enabled)? An additional problem is that he can't sudo to try changing the root password, since his username no longer is recognized as an admin. I had thought about booting up in single-user mode and trying to set a root password that way. It seems from what I've read that he'd probably have to run the /etc/rc script to start NetInfo first. Or, I also thought we could either edit or replace with a previously edited copy his /etc/sudoers file, including his new username in the list, since the error he gets when trying to sudo now is that he's not in that list.

So am I on the right track? Will any of this work? Is there a way to instead try and return things to the way they were from a shell? Say if we could return his short username to what it used to be so the system once again recognized him as an admin? This would of course also require some sort of root or sudo access I'm assuming.
     
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Jan 1, 2003, 03:03 PM
 
Boot into single user mode, mount the filesystems "rw", rename his home directory, change ownership of its files via "chown -R hisusername /Users/hisuserdir", then see if he can log in when you reboot.

BTW, to get into single user mode, boot up holding command-s. It will tell you the command to mount the filesystem when you get to the prompt.
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:51 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2