Skip to content

Instantly share code, notes, and snippets.

@gilangvperdana
Forked from lovellfelix/gist:1571bb3ed2d08b8cca9e
Last active July 4, 2022 12:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gilangvperdana/79ae635af71ba14b0a1008ee7b90ed98 to your computer and use it in GitHub Desktop.
Save gilangvperdana/79ae635af71ba14b0a1008ee7b90ed98 to your computer and use it in GitHub Desktop.
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.

Execution

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