0

As a root user, I created a file in / directory. I can only read this file when logged in as normal user (say A) as expected.I changed the ownership to A.Now A can read as well as write.But when I try to delete it, permission denied message comes.Can anyone explain why?

  • 1
    Can you post the output of /usr/bin/stat /yourfile? That would reduce the amount of guess work. – joepd May 26 '16 at 15:14
  • @joepd see the link in Jeff's comment. It's got nothing to do with the files permissions :) – forquare May 26 '16 at 15:15

1 Answers1

6

Deleting a file isn't a modification of the file, it's a modification of the directory containing the file. If you don't have the rights to modify the directory, you cannot remove the file within that directory.

Andy Dalton
  • 13,993