RHEL9 working with Linux Special Permissions LIKE SUID,SGID, Sticky bit Permissions PART-3

Опубликовано: 22 Октябрь 2024
на канале: techessay
28
1

Linux Special permissions: (SUID, SGID, and sticky bit)-


Special Permission Numeric Value Symbolic value
Sticky Bit 1 o+t
SGID 2 g+s
SUID 4 u+s

Syntax-
#chmod 7777 /sample
#chmod 777 /sample == #chmod 0777 /sample






user + s (pecial) SUID Super User ID
Commonly noted as SUID, the special permission for the user access level has a single function: A file with SUID always executes as the user who owns the file, regardless of the user passing the command. If the file owner doesn't have execute permissions, then small s changed in uppercase S here.

group + s (pecial) SGID
Commonly noted as SGID, this special permission has a couple of functions:
If set on a file, it allows the file to be executed as the group that owns the file (similar to SUID)
If set on a directory, any files created in the directory will have their group ownership set to that of the directory owner
This permission set is noted by a lowercase s where the x would normally indicate execute privileges for the group. It is also especially useful for directories that are often used in collaborative efforts between members of a group. Any member of the group can access any new file. This applies to the execution of files, as well. SGID is very powerful when utilized properly.
As noted previously for SUID, if the owning group does not have execute permissions, then an uppercase S is used by system to denote that.
other + t (sticky)
The last special permission has been dubbed the "sticky bit." This permission does not affect individual files. However, at the directory level, it restricts file deletion. Only the owner (and root) of a file can remove the file within that directory. A common example of this is the /tmp directory:
The permission set is noted by the lowercase t, where the x would normally indicate the execute privilege.
if the others does not have execute permissions, then an uppercase T is used by system to denote that.