|
Unix Advanced File Permission |
|
# chmod u + s < filename > SUID
# chmod g + s < file name> GUID
# chmod o + t <Dir Name> Sticky Bit
What is SUID ?
The common explanation given for SUID is, it is an advanced file permission SUID allows an user to execute a script as if the owner of the script is executing it.
Example for SUID is
#passwd
GUID bit is set on an executable. It runs with the permission its owner
To understand the concept about SGID
1. Create a group called online
2. Create a folder called training
3. Create 3 Users called John, Daniel & Joe
4. Add 3 users into the group called online
5. Change the group owner online for the folder training
6. Create a file or folders under the directory Online
7. Check the owner of the group for every folder & files
8. It is in the respective of User’s Group
9. Do delete a file or folder irrespective the owner of the group
10. Now set the GUID
a. # chmod 2775 /training
b. Check the SGID setting on the folder
11. Now do create the files & folders
12. Try to add one more user into the group
13. Test the ownership of the folder
14. Does inherit the ownership of the group for folders & files
15. So that what is SGID?
To understand the concept about Sticky Bit
1. Create a Folder called /alldata [ mkdir /alldata ]
2. # chmod 777 /alldata
3. Create a few folders and files from different User
4. Check the Ownership of the folder & file
5. Try remove folder & file from different User irrespective of the ownership since we have assigned the 777
permission
6. Now apply the sticky bit concept for the folder
a. # chmodt+o /alldata or # chmod 1777 /alldata
b. Now create the folders & files Under the folder alldata
c. Check the Ownership
d. Try remove folder & file from different User irrespective of the ownership since we have assigned the 777
permission
7. Now what do you understand the concept.
8. So that What is Stickbit ?
|