0

I created a file by redirecting output and the created file cannot be touched. Upon using any commands (such as paste, cut, rm), it tells me access denied. When I try to delete it using ftp, it says there is no such file, but I clearly see the file. Upon typing ll, where it shows the permissions, it says head or paste instead of rwx.

What should I do?

1
  • 2
    post the output of "ls -la filename"
    – pauska
    Oct 6, 2010 at 0:33

1 Answer 1

3

You can remove a file only if you have write permission to the directory it resides in, after that you can try to unlink it.

6
  • 1
    That's at least weird, anyway: 1. root can override any and all permissions, 2. check if you're not using ACLs 3. Are you using a UNIX file system (ext, xfs, etc.)? Oct 6, 2010 at 2:50
  • Root is not god on a mandatory access control system.
    – symcbean
    Oct 6, 2010 at 11:28
  • yes it's a very poor choice, but that was about your ability to delete files in directory you don't have write access to Oct 6, 2010 at 12:20
  • @bemace: Test again — as long as only unix filesystem permissions are involved, you do need write permission on the directory and not on the file. Some ACL systems (but not Linux's, other than potentially changing who has write permission), and security policy systems such as SELinux, can affect this. Oct 6, 2010 at 21:50
  • @symcbean: It's not a matter of mandatory vs. discretionary access system. You could have a MAC with a god user. SELinux restricts what root can do, but not because it provides mandatory access control. Oct 6, 2010 at 21:51

You must log in to answer this question.

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