Question | Answer |
The portion of a file's inode that stores permissions is known as the: | mode |
To change permissions for a specified file | chmod |
chmod Options: Add a permission for a user, group, or other (category) to a file | category+permission |
category+permission Example: Add execute permission to the myfile for user, group, and other | chmod u+x,g+x,o+x myfile |
Category-permission Example: Remove the write permission for group and others for the myfile file | chmod g-w,o-w myfile |
Category=permission Example: Grant the user read, write, and execute permission for the file myfile | chmod u=rwx myfile |
Chmod Options: Set the permissions of a file according to the numbers represented for each category | chmod decimal_value |
Decimal_value Example: Grant the user read, write, and execute permission, Grant the group read and execute permissions, and others just execute permission for the myfile file | chmod 751 myfile |
Sets the permission(s) recursively | chmod -R |
If -- -- is set, program will run with the permissions of the USER | SUID bit |
When issuing the ls -l command, SUID bit will show an -- in the --permission position of the USER permissions | An s in the execute position of the user: rwsrw-rw- |
If -- -- is set, program will run with the permissions of the GROUP | SGID bit |
When issuing the ls -l command, SGID bit will show an -- in the --permission position of the GROUP permissions | An s in the execute position of the group: rwxrwsrw- |
When issuing the ls -l command, Sticky bit bit will show an -- in the --permission position of the OTHER permissions | A t in the execute position of the OTHER Permission: rwxrw-rwt |
Mark a file in such a way as to prevent the file's DELETION from anyone except the file owner (works well with shared files) | Sticky bit - (does not work with directories) |
Chmod Options when assigning Special Permissions: decimal_value | The permission precedes the standard octal representation of a set of permissions |
chmod decimal_value: Value precedes the standard octal representation of a set of permissions - Set the SUID | chmod (4)421 |
chmod decimal_value: Value precedes the standard octal representation of a set of permissions - Set the SGID | chmod (2)421 |
chmod decimal_value: Value precedes the standard octal representation of a set of permissions - Set the Sticky bit | chmod (1)421 |
chmod decimal_value: Value precedes the standard octal representation of a set of permissions - Set both the SUID and the SGID | chmod (6)421 |
chmod category+permission - adds a special permission for a user, group, or other (category) of a file - Set the SUID | chmod u+s |
chmod category+permission - adds a special permission for a user, group, or other (category) of a file - Set the SGID | chmod g+S |
chmod category+permission - adds a special permission for a user, group, or other (category) of a file - Set the Sticky bit | chmod u+t |
chmod category-permission - Removes a special permission for a user, group, or other from a file - Remove the SUID | chmod u-s |
chmod category-permission - Removes a special permission for a user, group, or other from a file - Remove the SGID | chmod g-s |
chmod category-permission - Removes a special permission for a user, group, or other from a file - Remove the S | chmod u-t |
chmod decimal_value: Value precedes the standard octal representation of a set of permissions - Set the SUID, SGID, and Sticky bit | chmod (7)421 |
Changes (removes) the default file and directory permissions | umask |
By default files receive permissions of: | rw-rw-rw (666) |
By default Directories receive permissions of: | rwxrwxrwx (777) |
Identifies which permissions are REMOVED from the DEFAULT permissions when files (666) and directories (777) are created | umask |
Is the typical umask setting | 022 |
A umask of 022 results in a newly created file (default 666) permissions of | 644 (666 minus 022 = 644) - (rw-rw-rw- minus ----w--w- = rw-r--r--) |
A umask of 022 results in a newly created Directory (default 777) permissions of | 755 (777 minus 022 = 755) - rwxrwxrwx minus ----w--w- = rwxr-xr-x) |
Command to set a typical umask value | umask 022 |
view the current umask setting | umask |