Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I search these forums and the internet, but all results are about regular users wanting to delete files owned by root.
I have a slightly different problem.
I have files which are owned by root, but user root is unable to delete them?
Ow by the way, I am able to 'empty' the file or write other things in it.
So how the **** do I delete these things??
I don't know how the files are created.
I also reinstalled coreutils just to make sure a 'clean' version of rm is installed.
Might be a Remote File Inclusion, might be lax FTPd settings, I don't know either w/o details, but since it's got root ownership I'd comb the server over thoroughly. Start with the logs and auth data as recon will show up. That it's bad goes without saying, accessing an URI with the PHP file leads to D/L of a mcrsft executable, as in hosting malware. Who has access to the fs as userA and as groupA?
To expand on anomie's comment, in order to delete a file, you need permission to change the contents of the directory in which the file is listed. (After all, you're removing data from that file. [Note that a "directory" is just another file in *nix systems.])
And also note that the "directory" file coud be in a read only file system on some other physical device, so having w access on the "directory" does not necessarily mean that you can actually change the "directory's" contents. (This is an unlikely scenario, since lot's of other things would "go wrong" if the "directory" was on a r/o fs.")
First of all, thanks for all the replies.
After the hint of 'anomie', I looked further on how to view the permissions of a directory. lsattr normally only shows attributes of files. So I rechecked the man page and found that I need to use the '-d' option. So I did:
Code:
[root@ .montepio]# lsattr -d
su--ia-A----- .
Tata .. there's the bastard. After removing the attributes I was able to remove the complete directory:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.