Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 04-26-2004, 10:44 PM   #1
Registered: Mar 2003
Location: New York City
Distribution: Slackware 9.1, FreeBSD 5.2.1, OpenBSD 3.3
Posts: 89

Rep: Reputation: 15
Per-user directories with password protection (apache)

Basically, I've got a directory set up under my document-root called Users with directories inside it for different users. I have WebDAV enabled and set to give access to any user with a directory inside Users. The users are required to login before they access their shares, but any user on the system can access anyone elses share. How do I make it so that each user has to log in with his own username to access his share? Here is the relevant section of my httpd.conf:

UserDir /var/web/hosts/myserver/users/*

<Directory /var/web/hosts/myserver/users/*>

Options Indexes

AllowOverride None
AuthUserFile /var/web/.htaccess/myserver/.htpasswd
AuthType basic
AuthName "Home Directory"

Require valid-user

The Require valid-user clause allows any user with a valid login on the server to access a user's directory.

for example, if the user 'fred' tried to access, all he would have to do is login as fred and be able to access Jim's files, how do I get around this? Thanks.
Old 04-27-2004, 12:48 AM   #2
LQ Guru
Registered: Jan 2001
Posts: 24,147

Rep: Reputation: 229Reputation: 229Reputation: 229
Check out this page, its not full proof but its a way to redirect the user to their specific page or directory:

The only problem is if you have just a basic .htaccess file in the directory with all username and passwords, the only way around this is to create separate .htaccess for each users directory, with only their username and password in the .htpasswd file, etc.

Hope this helps any!



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating user directories in Apache root robojerk Linux - Networking 1 09-21-2004 12:34 PM
Password protecting directories in apache niverson Linux - Security 6 03-02-2004 10:40 PM
apache 2.0 user cgi-bin directories JHuizingh Linux - Software 3 03-19-2003 03:58 PM
apache password protection demicheru Linux - Software 2 02-25-2003 05:13 PM
apache user/password checkbox jdubu Linux - Networking 1 05-24-2002 07:12 AM

All times are GMT -5. The time now is 02:48 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration