Ask Your Question

unable to delete a file - forbidden to change with chmod or chown

asked 2014-10-10 17:20:46 -0500

xtrick gravatar image

a file has appeared in a sensitive folder out of the blue! when i try to delete it 'you do not have the required permissions' if i try to use CHMOD i get 'permission denied' if ii try to use CHOWN: 'operation not permitted'

This is my computer i must have the ability to remove what i want. If you cannot help me i will have to wipe the disk and probably try another linux too.

I fear this fille is some kind of trojan.

edit retag flag offensive close merge delete


that is not enough information to diagnose the root cause. which directory are you in, which user are you using, what are the permissions of that directory...

dnozay gravatar imagednozay ( 2014-10-12 16:47:25 -0500 )edit

If none of the solutions for your answer work, you might need to run fsck against this partition (filesystem might be corrupted). If you have access to a live GNU/Linux (e.g. Fedora Live Desktop), you can try deleting from there and see if it works or prints a similar error messages. You can also run fsck from there.

hedayat gravatar imagehedayat ( 2014-10-13 03:20:59 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2014-10-10 18:04:58 -0500

mclmmc gravatar image

updated 2014-10-11 02:50:49 -0500

pnemade gravatar image

Normally this means that you are not the owner, then only as an administrator you can operate (if you have permission); but it could be installed a rootkit.

run the following commands:

- file <your file>
- ls -l <your file>
- lsattr <your file>
- stat <your file>
- getfacl <your file>

if you are not able to understand the ouput, report it to us.

the output of file command must be compatible with the file extension if it ispresent.

edit flag offensive delete link more

answered 2014-10-12 00:33:44 -0500

linux.alder gravatar image

If you are root or using sudo when trying to make these changes... most likely the file is immutable.

If 'lsattr <your file>' returns an 'i' in the fifth position, then run 'chattr -i <your file>' and you should be able to make the changes you need.

have fun!

edit flag offensive delete link more

Question Tools


Asked: 2014-10-10 17:20:46 -0500

Seen: 503 times

Last updated: Oct 12 '14