Dr. Mark Humphrys

School of Computing. Dublin City University.

Home      Blog      Teaching      Research      Contact

My big idea: Ancient Brain


CA114      CA170

CA668      CA669      Projects

Notes on File protections

"ls -l" shows something like:
-rwxr-xr-- 1 userid  groupid  153 Nov  6 2008 filename

-	file (d for directory, l for link/shortcut)
rwx	User (u) can read,write,execute.
r-x	Other members of group (g) can read,execute only.
r--	Other people (o) can read only.

set via the "chmod" command.
see "man chmod"

    user      group      other
 [ ][ ][ ]  [ ][ ][ ]  [ ][ ][ ]

r - read
w - write
x - execute

user bits

Note if turned off, user has power to turn them on any time.
So these can only be for some kind of temporary self-check.

[r][w][-] Don't execute by accident.
Because UNIX will try to execute any text file as shell script if name is typed.
e.g. text files, web pages
[r][-][x] write-protect for safety
[r][-][-] both of above
[r][w][x] normal

group/other bits

Shared writable file
Shared read-only file
[-][-][-] Normal - Hidden from others

Minimum needed for Web files

(HTTP requests come in as "other".)

Web pages need r:


PHP scripts only need r, not x:


ancientbrain.com      w2mind.org      humphrysfamilytree.com

On the Internet since 1987.

Wikipedia: Sometimes I link to Wikipedia. I have written something In defence of Wikipedia. It is often a useful starting point but you cannot trust it. Linking to it is like linking to a Google search. A starting point, not a destination. I automatically highlight in red all links to Wikipedia and Google search and other possibly-unreliable user-generated content.