Created
March 31, 2011 15:13
-
-
Save MKo-xx/896536 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $ mkdir tmp | |
| $ sudo chown root:root tmp # change owner to root | |
| $ sudo chmod o+w tmp # add permission to other user to add files | |
| $ | |
| $ sudo mkdir tmp/123 # create a directory owned by root | |
| $ sudo chmod 777 tmp/123 # give all permissions, so other user can remove it. | |
| $ rm -r tmp/123 # remove it without any problem. | |
| $ | |
| $ sudo mkdir tmp/123 # create a directory owned by root again | |
| $ sudo chmod 777 tmp/123 # give all permissions, so other user can remove it. | |
| $ sudo chmod +t tmp # set on sticky bit | |
| $ rm -r tmp/123/ # try to remove it. | |
| rm: cannot remove `tmp/123': Operation not permitted | |
| $ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment