2

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?

2
  • 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, 2012 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. Jun 13, 2012 at 14:39

2 Answers 2

1

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.

2
  • Thank you. Is it possible to use %{remote_user} with this setup? Jun 14, 2012 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. Jun 15, 2012 at 14:15
1

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

1
  • 1
    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. Jun 13, 2012 at 16:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .