'Permission denied' to a file I own?

Solution 1:

> sudo ls -al ./log
drw-rw-r-- 3 bob bob      4096 Jun  2 04:11 .

It doesn't look like Bob has execute permissions for ./log, so he can't cd to it.


> ls -al .
drwxr-xr-x 2 bob bob 4096 June 1 14:22 log

shows that he does. But it doesn't look like they are pointing to the same file (different permissions, different modtime).

Try sudo ls -ail ./log and ls -ail to see if the inode is the same.

Solution 2:

Things are more simpler than filesystem corruption or selinux. As you can see you are missing the x (executable) permission on the log directory. Actually for directories x means that someone is able to change to that directory. Just do an "chmod +x log" to fix that perm and you should be able to access it.

Solution 3:

I have seen things like that when the filesystem has been corrupted, or if you have a failing drive. The fix usually is to run fsck against the filesystem and let it correct errors it has found.

Solution 4:

Also, check SE/Linux settings. Sometimes the permissions on the file don't have anything to do with whether or not you can access it.

Solution 5:

The files may have the immutable or append only extended attributes set. I've had this happen before and not even root could delete the file.

Extended attributes can be views via "lsattr" and altered via "chattr"