Score:-1

Cannot delete files from /home folder in centos7

cn flag

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?

Score:0
pw flag

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.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.