An Introduction to Unix Permissions

To understand how we can control filesystem permissions, we'll need first to review exactly what permissions are, and how they are set. Documentation of this subject from a Linux perspective is available at http://www.faqs.org/docs/linux_intro/sect_03_04.html. Our discussion here is not intended to be a Unix or Linux tutorial; we focus exclusively on the subject of permissions, and leave it to you to fill in any gaps.

Let's imagine a sample user timb, whose Unix-style directory listing (displayed with the command ls -l) might look like this:

drwxr-xr-x  2 timb  www   68 20 Nov 15:04 images -rw-r--r--  1 timb  www  545 20 Nov 15:04 index.php lrwxrwxrwx  1 timb  www    4  9 Nov 22:57 lib -> /usr/lib/php -rw-r--r--  1 ...

Get Pro PHP Security: From Application Security Principles to the Implementation of XSS Defenses, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.