Jan gave me the following piece of advice that I feel I have to write about to help me understand it. What I wanted to do was to set all file to 644 which basically means that the owner can write to it unlike any other losers and it can't be executed. The problem with doing a recursive chmod like this on all files is that you don't want to remove the executability of directories otherwise you won't be able to do useful stuff like ls inside the directory. The trick is to use the +X option. This is what I did:

$ sudo chmod -R 644 IssueTrackerProduct
$ sudo chmod -R +X IssueTrackerProduct

According to the man pages:

" execute only if the file is a direc- tory or already has execute permission for some user (X)"

I can't find a better reference about it now with Google because whatever I search for seems to always be talking about the little +x which has a very different meaning.

gustaf - 12 June 2005 [«« Reply to this]
lite mer hårdrock, lite mindre tänk. bärs bengtsson, bärs för guds skull.
gustaf - 12 June 2005 [«« Reply to this]
baba o'riley med the who. ladda hem nu sa jag. hv! annars phantom of the opera med järn maiden. för helvete bengtsson!
gustaf - 12 June 2005 [«« Reply to this]
I wonder if my comments actually are born on your www. så att säga. But let me say jeans and you will understand. Do i make myself clear or am i ruin your www. www=world wide web. jeanskalsong with a kapuschong. balle.
Peter Bengtsson - 13 June 2005 [«« Reply to this]
He he. Klart jag förstår vad min tjocke gamle jeanskompis har att säga. Syns om en vecka typ.
gustaf - 12 June 2005 [«« Reply to this]
with ruin i mean destroy. sorry ich cant bend it right. Henjeby.
fak3r - 10 January 2006 [«« Reply to this]
Thanks, I searched Google for this exact issue, and found your site. Thanks for posting it, I can now open up my directories to patrol agents, but not allow them to run files within. Perfect!

fak3r.com
Marcelo - 02 October 2007 [«« Reply to this]
If you do it in one command you dont need to be root, you can be just the owner of the dir:
chmod -R a-x+X yourdir
jkiv - 21 May 2008 [«« Reply to this]
Also, if you don't want 'other' from accessing...

chmod 640 -R directory
chmod ug+X -R directory

(Posting for my own reference. Thanks for the +X tip! I accidently set all my personal files to executables!)
pyg - 09 December 2008 [«« Reply to this]
find . -type f -exec chmod 644 {} \;
Double-V - 04 January 2009 [«« Reply to this]
very nice advice, thanks


Your email will never ever be published