Every possible UNIX/Linux file permission: Listed and explained (All 4,096 of them)
brian_s 270002K5X3 Comments (3) Visits (27181)
The generic read/write/execute UNIX/Linux file permissions are fairly easy to understand. But when you start getting in to the SUID, SGID, and Sticky bits things get more complicated and harder to understand.
For example, if you came across a file with "--S--S--T" permissions would you know what this means? By reading this short posting and referring to the table linked below, you would be able to quickly and easily decipher any possible file permission you might run in to and translate it in to english :)
Here is a little information on how SUID, SGID, and Sticky bits show up when looking at file permissions:
SUID permissions show up as a "s" in the 3rd column of the user permission set (i.e. rwsr-xr-x)
SGID permissions show up as a "s" in the 3rd column of the group permission set (i.e. rwxr-sr-x)
The Sticky bit shows up as a "t" in the 3rd column of the other permission set (i.e. rwxrwxrwt)
If you see a capital "T" in the 3rd column of the other permission set (i.e. rwxrwxrwT), this means that the sticky bit is set, but that there is no execute ("x") permission for others.
If you see a capital "S" in the 3rd column of the user or group permission sets (i.e. rwSr-xr-x or rwxr-Sr-x), it means that the SUID/SGID permission is set, but that the execute bit isn't set (which would kind of defeat the purpose... but it is still possible to set the permissions to this).
There are a total of 4,096 possible ways to set the permissions on a file. I created a table that shows each possible permission with its numeric mode, what the permissions would look like, and then a plain english explanation.
developerWorks wouldn't let me post the permissions table here in the blog because it would put my posting over the size limit, so here is the link: http