Three special permission in linux are SUID, SGID and Sticky Bit which is use to control the linux user in advance.
What is SUID?
The common explanation given for SUID is, it is an advance file permission SUID allows an user to execute a script as if the owner of the script is executing it.
Example for SUID
SUID bit is set on an executable. It runs with the permission of its owner.
Command :
What is SGID?
If the set gid bit on directory entry is set, file in that directory will have the group ownership as the directory, instead of than the group of the user that created the file.
Command :
What is Sticky Bit?
Before set the sticky bit permission for folder, the irrespective of the users has rights to delete the folder. If the sticky bit permission set for the folder, respective of the user has rights to delete the folder.
Example for Sticky Bit
Command :
What is SUID?
The common explanation given for SUID is, it is an advance file permission SUID allows an user to execute a script as if the owner of the script is executing it.
Example for SUID
root@linuxstorages:~#ls -l /usr/bin/passwd
-rwsr-xr-x 1 root root 22984 Jan 2006 /usr/bin/passwd
SUID bit is set on an executable. It runs with the permission of its owner.
Command :
root@linuxstorages:~#chmod u+s < file name >
or
root@linuxstorages:~#chmod 4755 < file name >
What is SGID?
If the set gid bit on directory entry is set, file in that directory will have the group ownership as the directory, instead of than the group of the user that created the file.
Command :
root@linuxstorages:~#chmod g+s < file name >
or
root@linuxstorages:~#chmod 2755 <file name >
What is Sticky Bit?
Before set the sticky bit permission for folder, the irrespective of the users has rights to delete the folder. If the sticky bit permission set for the folder, respective of the user has rights to delete the folder.
Example for Sticky Bit
root@linuxstorages:~#ls -ld /tmp
drwxrwxrwt 32 root root 36864 Mar 27 12:38 /tmp
Command :
root@linuxstorages:~#chmod o+t < Dir Name >
or
root@linuxstorages:~#chmod 1777 < Dir Name >
Simple explanation and getting easily .. :)
ReplyDelete