Difference between revisions of "Permissions"
m (add image) |
m (example header) |
||
Line 8: | Line 8: | ||
A symlink that looks like this "lrwxr-xr-x" in ls looks like this in octal mode: | A symlink that looks like this "lrwxr-xr-x" in ls looks like this in octal mode: | ||
0120755 | 0120755 | ||
+ | |||
+ | |||
+ | === Example permissions === | ||
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: | 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: |
Revision as of 02:51, 24 May 2008
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
Example permissions
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.
Also see the page covering groups.