next up previous
Next: Other Resources Up: Miscellaneous Previous: ext2 vs. ext3


An Explanation of UNIX Permissions

UNIX permissions, while seemingly complex, are really easy. There are 10 fields in any set of permissions, arranged as follows:

The special bit is used for things like directories (when it's set to `d'), links (`l'), and other things. Don't worry about it; you never need to explicitly set it.

The other three groups are all divided in the same manner -- the first bit means that the user/group/other has read permissions (`r'), the second write (`w'), and the third execute (`x').

There's a cute binary way of setting permissions that I find most intuitive. The read bit is worth 4, the write 2, and the execute 1. (Hold up the leftmost three fingers on one hand and pretend you're counting in binary). Therefore, any combination of u/g/r permissions can be specified by three unique numbers. `700' means that the user has read, write, and execute permissions (6+4+1) but that no one else does; `644' means that the user has read and write permissions, and that everyone in the same group and all others have only read permissions.

It's easy to change permissions using this notation. To change a file to 644, for example, just do:

chmod 644 file


next up previous
Next: Other Resources Up: Miscellaneous Previous: ext2 vs. ext3
Nori Heikkinen 2003-07-08