Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I made the fatal error of copying and pasting a sudo command into my terminal without double checking it, here it is.

sudo -R mysql /

What this does (for those that don't know) is recursively change the owner every file from the root down to mysql!! obviously not what i was intending

This has of course played havoc with my system, the first thing i did was the apple permission repair but that only works for files that it has an idea of though it has changed a lot of file ownerships back to root. It seems that many library files are still owned incorrectly, as a lot of problems don't work. What i propose doing as a temporary fix until i can reinstall mountain lion is to recursively set all ownerships that are mysql to Luke. I'm not sure what they should precisely but this is still better than nothing. Is this possible using a shell script?

I realise that this won't fix the problem properly and i will have to reformat but i need the machine in a workable state just for this week.

share|improve this question
add comment

2 Answers

If it's' OSX, then just reinstall the os. It won't wreck your data, it'll just bring the system files closer to default.

Then try going into the Recovery drive, if you have it, open Terminal from the menu, Type

resetpassword

and a window will pop up. At the bottom of that window is an option to reset the user ACL's.

That should fix your home directory.

Or, you could just use Onyx, there is a reset ACL's option there as well.

share|improve this answer
add comment

Those sound like valid options. But your first assumption would be the best way to go. The repair permissions function in OS X will get most of the system files; but if the issue is you can't run things as yourself, and you've only changed the user and not the group, then running 'sudo chown -R luke /' followed by repairing the permissions again will get you back to mostly useable until (or if) you reinstall.

As for fixing permissions in your user directory; you only changed the ownership... so 'sudo chmod -R luke /Users/luke' will fix that muuuch quicker than any tools will (might need to capitalize Luke, depending on your username on the computer.)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.