-1

I am trying to delete a file inside /home folder as root user but i am getting error "Operation not permitted". Below is the lsattr of file

-----a-------e-- /home/test/.bash_profile

also if i create any folder or file inside /home folder it is created but i cannot delete it afterwards getting same error "Operation not permitted"

Any idea what is going on?

1 Answer 1

0

The file attribute has been set to append (the 'a' in '-----a-------e--') only.

sudo chattr -a /home/test

That will unset the append only attr flag and allow you to rm the file.

Edit: Apologies, I noticed you said it is happening on all files after I answered. The +a attribute may have been set on the parent dir. Any folder set with '+a' will cause any file put in the dir to inherit the +a flag.

Not the answer you're looking for? Browse other questions tagged .