Linux Redhat lab: Use chmod with Special Permissions



Linux Redhat lab: Use chmod with Special Permissions

Linux Redhat lab: Use chmod with Special Permissions

Link playlist
https://www.youtube.com/playlist?list=PLIpLw6v7Z1qmty_yT3KQUeV5jW46Wu7hG

2023 07 29 18 36 21

Exercise 7-2 Working with Special Permissions 1. Start this exercise from a root shell. 2. Use su – linda to open a terminal in which you are user linda. 3. Use cd /data/sales to go to the sales directory. Use touch linda1 and touch linda2 to create two files of which linda is the owner. 4. Type exit to go back to a root shell, and next use su – laura to switch the current user identity to user laura, who also is a
member of the sales group. 5. Use cd /data/sales again, and from that directory, use ls -l. You’ll see the two files that were created by user linda that are group-owned by the group linda. Use rm -f linda*. This will remove both files. 6. Use the commands touch laura1 laura2 to create two files that are owned by user laura. 7. Use su – to escalate your current permissions to root level. 8. Use chmod g+s,o+t /data/sales to set the group ID bit as well as sticky bit on the shared group directory. 9. Use su – linda and type cd /data/sales. First, use touch linda3 linda4. You should now see that the two files you have created are owned by the group sales, which is group owner of the directory /data/sales. 10. Use rm -rd laura*. Normally, sticky bit prevents you from doing so, but because user linda is the owner of the directory that contains the files, you are allowed to do it anyway!