setuid grants temporary access permission. A normal user inherits root privileges for the purpose of that process. setuid bit is represented by an S/s.
-rwSrw-rw- –> Setuid bit set, not executable
-rwsrw-rw- –> Setuid bit set, executable
syntax:
chmod 4*** file
e.g.: chmod 4644 /etc/passwd
setgid works the same way with setuid. The difference is; instead of the root, the group privileges are inherited. setgid is bit represented by an S/s.
-rw-rwSrw- –> Setgid bit set, not executable
-rw-rwsrw- –> Setgid bit set, executable
file should be a member of the group, to access privilege.
syntax:
chmod 2*** file
e.g.: chmod 2755 hexdump
stickybit keep programs in swap even after execution. Files in a directory with the sticky bit set can not be deleted by anyone other than the owner of the file, the owner of the directory, and the root user. Sticky bit is represented by an T/t.
-rw-rw-rwT –> Sticky bit set, not executable
-rw-rw-rwt –> Sticky bit set, executable
syntax:
chmod 1*** file
e.g.: chmod 1755 myfile