Skip to content

Instantly share code, notes, and snippets.

@lovellfelix
Created September 10, 2015 16:58
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save lovellfelix/1571bb3ed2d08b8cca9e to your computer and use it in GitHub Desktop.
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
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