======File Permissions===== There are 6 permissions in Linux These are the standard ones **Read write execute** ^ File Type ^ Owning User ^ Owning group ^ Other ^ | d (directory) | rwx | r-x | --- | There are 3 special permissions ^ Permission ^ effect on directory ^ effect on file ^ | u+s (suid) | no effect | File executes as the user that owns the file, not as the user that ran the file| | g+s (sgid) | Files that are created in the directory have a group owner to match the group owner of the directory| File executes as the group that owns the file. | | o+t (sticky) | Users with write access to the directory can remove only files that they own; they cannot remove or force saves to files that other users own | no effect| ===Sticky bit=== * This applies only to directories * Only the owning user can delete a file from a directory * Applied with **chmod o+t** or **chmod 1NNN** * Identified by a t in permissions for others Permission will appear as a **T** if the execute permissions is not set for other. If this permission is set it will appear as lower case ===SetGid bit=== * Set on files and directories * The owning group of a newly created file is derived from the directory that the file is created (for directory) * THe executables run with the permissions of the owning group of the executablers (for files) * To set use **chmod g+s /dir** or **chmod 2NNN /dir** or for files **chmod g+s /file** or **chmod 2NNN /file** * Identifed by an **s** in permissions for the owning group ===SetUID bit=== * this is for files only * executables run with permissions of the owning user of the executable * to set use **chmod u+s /file** or **chmod 4NNN /file** * identified by an **s** in the owning user