Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Reset ownership of Home items to fix problems System
My brother was having a lot of problems with his computer recently. He couldn't sync his Palm because the Transport Monitor wouldn't start (it kept giving a "9460 error"). Mail.app kept asking him for his password. Other preference settings simply wouldn't save.

I figured that there was something that didn't have the correct permissions set, and it was most likely in his home directory. Read the rest of the article for the process we used to fix the problem.

WARNING: Please be very careful when doing this, if you accidently set the user for your files to a different user, you run the risk of not being able to boot at all. This writeup is intended for beginners, so please excuse me if it seems overly detailed.

Go to the System Preferences application and then open the Users pane (or the Accounts pane in 10.2). Select your user and then hit "Edit User...". Look at (and remember!) your "Short Name"; you'll need it later. Open the Terminal application (It's in Applications -> Utilities). You should already be in your Home directory, but to be sure, type:
  cd ~
Make sure you hit return to execute the command. The ~ is the shift of the key to the left of the 1 on an English Keyboard.

WARNING: The next step is going to reset all the files in your home directory to be owned by the short name you enter, so BE SURE THAT YOUR short name IS THE RIGHT ONE!!! Type:
  sudo chown -R short_name *
Again, hit return to execute the command (of course replace the short_name with the short name you noted in the previous step. For example if your short name was myname, then you'd type:
sudo chown -R myname *
I hope that helps someone else out; it definitely fixed my brother's (seemingly random) system errors.

[Editor's note: This is one of those things you should not have to do from the Terminal, as the Get Info box has onwership information and an "Apply to enclosed items..." option. However, it also groups permissions with owernship, so if you were to try to simply set the owner for all items in Home, you would also change the permissions to the shown defaults ... which means, amongst other issues, you would break the "Public" folder, which has a different set of permissions!]
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[7,906 views]  

Reset ownership of Home items to fix problems | 4 comments | Create New Account
Click here to return to the 'Reset ownership of Home items to fix problems' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Reset ownership of Home items to fix problems
Authored by: willhaus on Mar 12, '03 04:56:45PM

I've been trying to do something exactly this ever since the permissions of my Home folder got all switched around after a move from one computer to another.

Questions:
1. Re the ed's note: If I go ahead and do this and break permissions on Public and Sites folders, I can just go back and fix those with the Finder right? Not too many files over there, so it shouldn't be too bad.

2. Will thiis take care of hidden folders like .Trash? Right now mine is owned by another user! Obviously I'd like to get it back.

3. Are there any files anywhere in my Home directory I wouldn't want to do this too?

4. I understand this will reset all ownership to me. How do I set all groups to "staff" with read only permissions and "Others" to read only which seems to be the default?

Thanks-
Willhaus



[ Reply to This | # ]
A safer way...
Authored by: noworryz on Mar 12, '03 10:42:24PM

It's better to use the -RP option, so you don't follow any symbolic links. Enter the following in the terminal, copying the capitalization and spacing exactly:


cd
sudo chown -RP $USER * .[^.]*
sudo chgrp -RP staff * .[^.]*
sudo chmod -RP u+rwX * .[^.]*

Then type ls -laF to see the effect you had. This will fix any problems with your home directory's visible and invisible files.

[ Reply to This | # ]

Fixing permissions...
Authored by: noworryz on Mar 12, '03 11:04:54PM

Once you have the ownership and group fixed, as shown above, you can get the permissions the way you want them without using sudo.

First give yourself the correct permissions, denying access to all others:


cd
chmod -RP u=rwX,g=,o= * .[^.]*

Then, if you want, give read access to user in your group and all other users:


cd
chmod -RP g+rX,o+rX * .[^.]*

That's it!

[ Reply to This | # ]

Fixing permissions...
Authored by: Coumerelli on Nov 24, '03 11:33:55PM

noworryz - YOU are the man!!!!! You helped save my hide. After copying my whole drive from one comp to another the permissions were ALL screwed up. I did what you said, and BAM it worked. YOU Da man!!!! (or woman ;))

Thanks a million (figuratively). And for anyone who is scarred, do it, but just keep an eye out for typos.

---
"The best way to accelerate a PC is 9.8 m/s2"



[ Reply to This | # ]