0

tried chattr on a file but can't revert it's effect.

currently it looks like

lsattr /path/myfile
--------------e----- /path/myfile
ls -la /path/myfile
-rwxr-xr-x 1 root root 0 Jul  5 11:12 /pat/myfile

still

sudo echo "text" > /path/myfile
-bash: /path/myfile: Permission denied

Is there any solution so that I can write with sudo or revert the chattr settings ?

Tilman Schmidt
  • 3,778
  • 10
  • 23
  • 1
    Do these answer your question? https://serverfault.com/questions/540492/sudo-echo-bla-etc-sysctl-conf-permission-denied https://serverfault.com/questions/1000184/why-can-i-update-a-file-owned-by-root-using-sudo-vi-but-not-append-a-line-to-it/1000186#1000186 – Tilman Schmidt Jul 05 '22 at 09:57
  • @TilmanSchmidt thanks for that. It explains the background. Not sure if I ever enncountered that before. – user3732793 Jul 05 '22 at 15:51
  • @TilmanSchmidt thanks you already clarified with the first reply. I was able to solve the issue – user3732793 Jul 06 '22 at 18:31

0 Answers0