I'm starting with chmod. I've set up a group and gave them permission (777) and every user inside the group is able to do whatever they want inside the directory /www/.

However, I need to change the permissions to anyone else. So I wrote down:

$ chmod -R o-rwx /www/ && chmod -R o+rw /www/some_interesting_dir

Because I wanted only to allow him access to that directory. But he's unable to perform "cd /www/some_interesting_dir", console says permission denied.

What am I doing wrong?

Thank you very much!


Instead of o+rw you should use o+rwX which will apply the execute permission bit to all directories in the structure too, allowing users to actually access them. (The execute bit is required to cd into or read files from a directory or any subdirectory.)

  • +1 I was actually unaware of the +X for recursively specifying directory permissions.
    – meagar
    Nov 15 '10 at 20:09
  • 1
    @meagar: Thanks. +X is actually defined in man chmod as "execute/search only if the file is a directory or already has execute permission for some user." So it may alter the permissions of files too if they are e.g. 700.
    – cdhowie
    Nov 15 '10 at 20:11

With directories, the executable bit allows you to view the contents of the directory. You need to add 'o+x' for directories:

find -type d -exec chmod o+x "{}" \;

Giving other users +rw permission seems to defeat the purpose; you're giving everybody write permissions to everything in the directory.


A user must have execute access to the directory he's passing through, the result is that while he can see what's in /www/ he still can't do anything to any of the files in there (As they have their own permissions)

Just chmod o+x www

  • The guide didn't say so, but it worked! Thank you very much for your fast response!
    – Lenders
    Nov 15 '10 at 20:08
  • We need a way to PM new users to inform them they forgot to mark answered :) Just a general statement...
    – J V
    Nov 15 '10 at 20:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy