Explain about set uid (suid)?
If we plan to allow all the users to execute the root users command then we
go for set uid (suid).
It can be applied for user level and is applicable for files only.
# chmod u+s <file name> (to set the suid on that file)
# chmod u-s <file name> (to remove the suid from that file)
# ls -l (if 'x' is replaced with 's' in owner's level permissions that
means suid is applied on that
file)
- r w s r w x r w x <file name> (here 's' is called set uid or
suid)
Example : # chmod u+s /usr/sbin/init 6 (then any user can restart
the system using this command #init 6)
# chmod u+s /sbin/fdisk (then any user can run the fdisk command)
# strings <command name> (to read the binary language of the command
ie., the string
command converts the binary language into human readable language)
# strings mkfs (to read the mkfs command's binary language into human
readable language)
* Normally set uid (suid) permission will be given on scripting files only.
43. Explain about set gid (sgid)?
If we plan to allow all the users of one group to get the group ownership
permissions then we go for
set gid (sgid). It can be applied for group level and is applicable on
directories only.
Example: # chmod g+s <directory name> (to set the sgid on that
directory)
# chmod g-s <directory name> (to remove the sgid from
that directory)
44. Explain about sticky bit?
It protects the data from other users when all the users having full
permissions on one directory.
It can be applied on others level and applicable for directories only.
Example : # chmod o+t <directory name> (to set the sticky bit
permission on that directory)
# ls -ld <directory name>
r w x r w x r w t <directory name> (where 't' is called
the sticky bit)