Skip to content

Instantly share code, notes, and snippets.

Forked from lovellfelix/gist:1571bb3ed2d08b8cca9e
Last active July 4, 2022 12:25
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Linux Files Immutable?

Linux Files Immutable?

Ever feel 'operattion not-permitted' on linux, please do this to revert or even if you want to protect a file to be safe.


cat ~/.ssh/ > 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 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment