MacOS – Asking for password when adding new folder in /Users/…/Sites/

macospermissionterminal

My Mac's hard drive was recently replaced, and I copied my folders over from my old drive to the new one. One problem, however, is my sites folder. Originally, I had them located in /library/webserver/sites/, but now they're just in /Users/.../sites.

If I try to create a new folder within any of the subfolders, it will prompt me for my admin password. The same happens in Coda when I'm trying to add a new folder, but there it just denies me.

Basically, how can I fix the permissions on these files so that I no longer need to enter my admin password? The files are the same, if I try to save one of them, I also need to enter the password.

Update: TextWrangler is giving me the error -5000.

Update 2: So is Terminal: ERROR: Unexpected Error. (-5000)

Best Answer

Easy fix. Open Terminal.app and type the following command:

sudo chmod -R -N /Users/*/Sites
sudo chmod -R 744 /Users/*/Sites

(edit: Added -R to recursively change permissions) (edit: Kudos to ughoavgfhwless for pointing out the -N flag to reset the ACLs)

You will be asked for your password. Enter it (keep in mind it won't show up in terminal). Now, assuming there isn't a more serious issue with your OS X installation, this will correct the permissions on all of the users sites folders. (If you installed OS X on a case-sensitive HFS partition, you need to make sure the case of the command matches the case of the directories. If you don't know about this, it's safe to assume you can ignore this and proceed with the above listed command.)

Good luck and happy chmoding!