Created
September 10, 2015 16:58
-
-
Save lovellfelix/1571bb3ed2d08b8cca9e to your computer and use it in GitHub Desktop.
Make Linux files Immutable. Prevent user from deleting or modifying authorized_keys file
This file contains 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
cat ~/.ssh/id_rsa.pub > authorized_keys | |
chattr +i authorized_keys | |
rm authorized_keys | |
rm: remove write-protected regular file `file1'? y | |
rm: cannot remove `file1': Operation not permitted | |
# To revert to previous state | |
chattr -i authorized_keys | |
#Linux is pretty awesome :) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment