Lost admin perms and want them back.

ChrisM666

Registered Idiot
I lost admin rights to my Mac after a crash and the only other user, also admin, seems to have been make boss-admin user in that all the apps that I 'owned' are now in his name! Just re-adding my name as an admin user did not change this wrongful allocation.

How do I reverse this situation?
 
Just read that, thanks to you. The success that one had with "Go to ~/Library/preferences/ByHost/ and delete all com.apple.HIToolbox files." etc. was not mine, too. Still all files that I previously 'owned' have the other admin user's name in them!

A solution that occurred to me and fell on deaf ears in another forum was to delete (as 'root') the other admin user and re-establish myself as the sole admin user - maybe turning myself into a Standard and then into an Admin to try to nudge the system. I suspect this will mirror what happened during the crash when my user vanished and left the other as the sole Admin left.

Any thoughts, anyone, about possible pitfalls here?
 
Who is the other admin user? If you delete it, all the data in that user's folder is gone. And it will not make any difference for the system to consider you more likely to be the only admin user.
If the admin user permissions for a user are gone, they are gone, no matter what the settings are for other users.
As long as you have the install discs for the last OS in your system, this should work. If it's 10.6, use the 10.6 discs obviously
http://support.apple.com/kb/TS1278
You don't need to disable root after, but it would be a good practice.

Hey, forgot a simple thing - did you try reparing permissions in Disk Utility (when the OS is running)? This would be one of the cases that would actually make sense...
 
The link was not useful as my old admin user was not turned into a Standard, the user was actually wiped/obliterated from system/Accounts but with all files still intact in /Users. All installed apps that I had installed had had their owner - the first name in Get Info - changed to the other admin user name. Which explained why I couldn't Save Game when I really needed to and the increased number of times I'm required to authenticate for actions that didn't need me to before. This change really surprised me as it might have surprised you. Never heard of such a ting before.

The other admin user is my 36 year-old heavy-weight-system manager son. He didn't do it!
 
/System/Accounts? Does that folder exist in your system? (Or if you meant some other location, please specify)
Does /Users contain only the expected users?
Are all apps installed by you showing with those permissions, or just selected ones?
(if the apps were installed for all users, they should still show System as owner)

I haven't seen a /System/Accounts folder in OS X, not even in the server version.
The users should be showing in /Users. So if there is /System/Accounts, it would probably be good to know how that came into existence.
If there are a number of extra or unknown folders in /Users, was the shortname of the home folder changed?
Odd indeed.
 
System/accounts = System Preferences -> Accounts. Sorry. Haste doesn't help clarity.

My /Users shortname folder tree was untouched. When I recreated myself while logged in in Single User Mode I was able to take it over during the creation of the 'new' username.
 
Thanks for that, but being able to take over my old 'unused'(remember, my user-name had vanished but the folder was still there) saved me from having to do the stuff in the article quoted.

I'm going to try the earlier-mentioned action and will report what happened. Cross fingers for me!
 
SOLVED
It all works now! How? Short answer is:
sudo find -x /(relevant folder) -user 502 -exec chown -hv 501 {} +
(courtesy of Hal Itosis on macrumors.com)

The long answer is:

All files that were once mine (the initial admin user) with ID 501 were now owned by 502 who was a temporary (admin) user a day or so before the crash.

I went in on Single User Mode, activated the System Admin (root) account and passworded it.

I re-created my original user (chrism) as an admin and was offered my old /Users/chrism folders back. All seemed well until I noticed an increase in 'authentications' required of my actions and an inability to save in my current game. This disaster led me to check the Get Infos and found that the temporaryadmin was now these files' owner.

Initially, I, as root, dropped him to Standard user but that didn't help my status even though I was now the only admin on the block.
Before checking his UID (it would have been instructive to have done so) I, as root, deleted his user and .dmg-ed his files (just in case, although his usage was temporary).

After some reading, I ran
sudo chown root:admin /
and
sudo chmod 775 /

After this, I confirmed my status by running the command
id
which said that I was back to having UID 501 and group 20.

The worrying apps, etc, were still UID 502 and group:admin, so I ran
sudo find -x /Applications -user 502 -exec chown -hv 501 {} +
and ditto with all folders I thought remotely likely to have 502s in them. Pretty much the whole tree: /Applications/Utilities, Library, private, Volumes, individual files in the root e.g. /r* and /.*. This last found a folder tree called '/./Applications/Picasa.app/*' which is a piece of 'Applications' that was missed the first time. Run this line many times on large folders like Applications until they returns empty and then on '/' again.


I hope this helps someone, sometime.
 
In case anyone wants to know, of the 'find' line quoted earlier, I ran 15 passes on the folders and some files wildcards and 7 more were needed on the disk root to modify all qualifying files. Something to do with how much memory is available to the shell? My iMac has 4GB RAM and I didn't notice the free memory dropping away at the time.
 
Good that all files&apps permissions are solved now, Chris. Thanks for the post explaining what had happened, and how you resolved it. Now it can hopefully help others running later to a similar problem with the same cause.
 
Back
Top