Difference between revisions of "Permissions"
Line 15: | Line 15: | ||
0755 "-rwxr-xr-x" file with permissions read-write-execute for owner, read-execute for group, read-execute for others. | 0755 "-rwxr-xr-x" file with permissions read-write-execute for owner, read-execute for group, read-execute for others. | ||
+ | |||
+ | For more information about the modes see ''/usr/include/sys/stat.h'' for the S_* defines. |
Revision as of 03:56, 28 October 2005
Permissions, also called mode, are the part of an inode that grant access to a file to different users in a system. The mode is a 16 bit unsigned integer and has bits set for different inode modes. Most of the time this mode is manipulated in octal or a visual representation as output by the ls program. The type of file is also included in this here is a few examples:
A directory that looks like this "drwxr-xr-x" in ls looks like this in the octal mode: 040755
A symlink that looks like this "lrwxr-xr-x" in ls looks like this in octal mode: 0120755
To most this will look very strange as we usually use the last 4 octal digits, here is a rundown on a few of them:
04555 "-r-sr-xr-x" setuid to owner file with permissions read-execute for owner, read-execute for group, read-execute for others.
02555 "-r-xr-sr-x" setgid to group file with permissions read-execute for owner, read-execute for group, read-execute for others.
0755 "-rwxr-xr-x" file with permissions read-write-execute for owner, read-execute for group, read-execute for others.
For more information about the modes see /usr/include/sys/stat.h for the S_* defines.