I'm running Mountain Lion and I have a folder in ~/sites that has a red icon on the folder folder icon and I can't open it because 'access is denied'.

What I've tried:

  1. Get Info > unlock with admin password, change 'everyone' privilege to 'read write' but won't change so tried 'read only' but still 'access denied'

  2. Terminal > sudo chmod -R 0777 ~/sites/lockedfolder

  3. Terminal > sudo chmod -R 0777 ~/sites

  4. Terminal > sudo chmod a+rwx ~/sites/lockedfolder

  5. Terminal > sudo chmod a+rwx ~/sites

  6. Disk utility > repair permissions and steps 1-5 again but no luck

All users now show 'read write' access in get info window but still folder icon and no access...


What can I try next?

  • can you access it from the command line when you are root. ie after running sudo -s? If so can you then delete the folder and recreate it?
    – Deesbek
    Oct 15, 2013 at 22:43
  • 1
    @Deesbek I can see the folder contents in terminal using ls without sudo command only finder is blocking it... I wanted to avoid deleting and recreating it if possible but I'll try that now.
    – doovers
    Oct 15, 2013 at 22:52
  • have you killed finder and restarted it? 'Killall Finder' Seems like it is a finder issue. How was the folder created?
    – Deesbek
    Oct 15, 2013 at 22:55
  • @Deesbek I think you could be right about it being a finder issue. I deleted and recreated the folder successfully but had some issues reinstating the permissions for _www but after randomly unlocking and relocking the get info window everything just popped up as expected... So it probably would have been solved easily with killall finder. If you want to write that suggestion an answer I can mark it solved.
    – doovers
    Oct 16, 2013 at 1:56

4 Answers 4


This is probably due to an issue with Finder. Relaunch finder with the following command in terminal:

killall -HUP Finder

In addition to the Unix file permissions, there are old HFS file bits. To unlock your folder try:

Terminal > chflags nouchg ~/sites/lockedfolder

Alternatively, you could do a Get Info in the Finder, and uncheck the "Locked" checkbox from that window.

enter image description here

  • You can also do this with `chflags nouchg'.
    – da4
    Oct 16, 2013 at 15:58
  • Thanks Mark, good to know for future reference! Sorry I can't upvote but my rep is too low for now :)
    – doovers
    Oct 17, 2013 at 0:07
  • As fyi, /usr/bin/SetFile was deprecated with Xcode 6 along as were other tools supporting Carbon development; although SetFile still appears to install as part of Xcode 12 additional command line tools. May 29, 2021 at 2:55
  • Edited to remove SetFile
    – Ɱark Ƭ
    May 30, 2021 at 16:46

Download BatChmod, free and very, very handy.

When one is done working, correct permissions are easily restored.


Giving myself ownership of the directory solved the problem for me:

sudo chown -R $(whoami) .

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .