% mkdir safe % chmod og-rwx safe % echo "Hello" > safe/secret % chmod a-x safe % ls safe secret % cat safe/secret cat: safe/secret: Permission denied % chmod u+x safe % cat safe/secret HelloSome readers will get a different result for the ls command:
% ls safe ls: safe/secret: Permission deniedIf this happens to you, try the command /bin/ls safe instead of just ls safe. Does that give the correct output (secret)? It should, and here's why:
Your ls command has probably been aliased to add options like -F to the plain ls command. Many ls options need to read a file's inode to get the extra information. For instance, -F and --color identify the type of file (directory, symbolic link, etc.). The file's inode isn't accessible unless you have x (execute) permission on the file's directory. So, if your ls has been aliased and needs to read the file's inode, it may give a "Permission denied" error when the lack of x permission keeps it from reading the inode.
Then she'd use chmod 750 users.xml (or chmod u=rw,g=r,o= users. xml) ...
The mode should be 640, and the filename shouldn't have a space in it. The sentence should start:
Then she'd use chmod 640 users.xml (or chmod u=rw,g=r,o= users.xml)
[October 2002 errata] [Return to articles page] [February 2003 errata]
Last change: 30 April 2003
Contact Jerry Peek