Showing posts with label permissions. Show all posts
Showing posts with label permissions. Show all posts

Friday, March 29, 2013

Permissions problems when using UserDir mod with Apache2

I have had trouble in the past getting Apache to work properly with the UserDir mod. I just installed a new server and had to solve the problem again. In the past I set ww-data (Apache's user) as the group owner for all user's home folders as well as public_html, which is a pain and feels wrong somehow.

Turns out the issue is that Apache needs executable access on all parent folders at the "everyone" level.

So anyway, the following command did the trick by setting the x bit at all levels on the home directories.

# chmod 711 /home/*

The downside of course is that someone can run applications in any other user's home folder if they know the name of the program and where it is stored.
This forum exchange tipped me off to the solution.

Saturday, January 19, 2013

Using fuser to find who's doing what

I just ran across a use of the program fuser which I have never used. It might come in handy for debugging stuff. It is used to identify processes using files or sockets.

It was suggested to use fuser to find what user has access to my sound card.
~ $ fuser -v /dev/snd/*          
                     USER        PID ACCESS COMMAND
/dev/snd/controlC0:  tward       785 F.... cairo-dock
                     tward       791 F.... pulseaudio