Question

I'm trying to give read permissions to lighttpd access logfiles to normal users which are on the same system. The permissions are currently:

-rw-r--r-- 1 www-data www-data 211K Feb 28 11:27 /var/log/lighttpd/access.log

So, if I understood correctly others have read permissions. Unfortunately this doesn't seem to work. If I try to read this file with an user account I get:

/var/log/lighttpd/access.log: Permission denied

I already tried to add the user to the group www-data which didn't work as well. Any hints what I'm doing wrong here?

Was it helpful?

Solution

To access a file, the system needs the execute permission on all the directories containing the file.

In this case it was necessary to issue the chmod o+x /var/log/lighthttps command (after making sure that the user belongs to the "other" part of the permission set).

The "execute" permission for a directory allows you to enter it. The "read" permission for the directory allows you to see the names of the files inside. The interesting thing is that you can give the x permission alone, what means that anyone can access the files inside, but he needs to know its names.

OTHER TIPS

You might not have execute permission for the lighthttpd so the directory does not give the permission to access its containing file.

Use the command to set the execute permission to that directory.

chmod +x /var/log/lighthttpd 
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top