Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to make my users' home directories available to them over the web. I have LDAP authentication in place so only valid users can access the home directories but currently a valid user can access any given home directory. I want to jail users to their own home directory. Is this possible with Apache?

share|improve this question
    
Just to be clear, when say jail, "/~joebob" is only accessible to the user joebob, but joebob could not go to "/~thomvu"? –  sysadmin1138 Jun 13 '12 at 14:33
    
Correct. I'm aware of the Apache variable REMOTE_USER but I'm not sure how, if I'm even able to, use that to keep users in their own directory. –  Tristan Hall Jun 13 '12 at 14:39

2 Answers 2

up vote 1 down vote accepted

You could use vhost-alias, to deliver the user in their directory after authentication, and they won't be able to go into anyones else's directory.

share|improve this answer
    
Thank you. Is it possible to use %{remote_user} with this setup? –  Tristan Hall Jun 14 '12 at 14:06
    
I don't have the capability to use wildcard subdomains for this setup so I wasn't able to fully implement this solution. However, it looks like this would be the best course of action. –  Tristan Hall Jun 15 '12 at 14:15

You probably are looking for the directive UserDir

UserDir public_html

This will have apache look for public_html.

For example

http://example.com/~username/index.html

will look for the file /home/username/public_html/index.php

share|improve this answer
    
I am currently using the UserDir directive and I have it set to /home so that users can browse through their files within their home directories. However, once a user has been authenticated they can access everyone's home directories. I want to make it so that they can only access their own home directory. –  Tristan Hall Jun 13 '12 at 16:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.