Home
Monday, December 18, 2017
8:01:41 PM
Users online: 0   You are here >> Home > Mac

Forums | Mac Forums search
Forum FAQ
   
  1  
lost admin rights? not sure how - 10.5.3
Malicine 
22/7/08 2:55:23 PM
Overlord

All of a sudden lost admin rights for my MBP this afternoon, not sure how.
I cannot even 'sudo' in the terminal!

my MBP was left on my desk over lunch but it's unlikely someone else touched the machine as my desk is in a secured area with limited swipe access... you never know though.

Anyone know how I can fix this without the boot disks? I'd rather not loose a few hours of my day to go get them.

-----

Linux_Inside V2 
22/7/08 3:22:40 PM
Immortal

You can boot up in single user mode by holding command+s at the boot chime until you see a black screen with white text
then type
mount -uw /

then
 
dscl localhost -list /Local/Default/Users

Which should list users, the reason for this is that you need to find the shortname for your username that osx uses. usually it'll just be your first name, in my case it's "matt" and my Username in the login window is "Matt Harlum"
To add the user to the admin group
 
dscl localhost -merge /Local/Default/Groups/admin GroupMembership matt

replace matt with your correct username

then type "exit" and it should load into the regular multi-user mode you're used to and you'll be an admin user yet again.
If sudo isn't working after this still, you've either put the wrong username in the group, or your sudoers file has been modified.


Edited by Linux_Inside V2: 22/7/2008 03:23:47 PM

-----

Malicine 
22/7/08 3:32:31 PM
Overlord

Thanks, I actually just finished doing a similar string from single user.

Murpheys Law; just as you figure it out someone will bring the answer :)

Any Idea how the admin group list would get corrupted?
I am the only user and rarely exit from root.




Edited by Malicine: 22/7/2008 03:36:39 PM

-----

Linux_Inside V2 
22/7/08 3:37:22 PM
Immortal

Not sure how, but I wouldn't be running as root on OSX all the time :P

What was the method you used? I would've been quicker but the method I used for Tiger is no longer possible in Leopard (They replaced Netinfo with Directory Services)

-----

Malicine 
22/7/08 3:48:28 PM
Overlord

bah, it saves time :) that machine is 100% stand alnone anyway.

I had help from http://discussions.apple.com/thread.jspa?messageID=7478098&#7478098

dscl . read /groups/admin GroupMembership
Came back as an error

rebooted to single user

/sbin/fsck -fy

/sbin/mount -uw /

launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist

rm /var/db/dslocal/nodes/Default/groups/admin.plist

dseditgroup -o create -i 80 admin

dscl . append /groups/admin GroupMembership myshortname


Checked membership again, I was in it. :)

I'm surprised you can do this so easily, assuming an admin gave you a user you could just add your user to the list and gain root with your normal password, no?

-----

Linux_Inside V2 
22/7/08 8:03:41 PM
Immortal

With Single user mode you can create an account yourself! :P

-----

Malicine 
24/7/08 11:30:12 AM
Overlord

[scratches chin]... yes, the mind boggles :)

-----

  1  
Forums | Mac