Re: [users@httpd] Limit user per directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 2/6/06, Cj B <black@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> Hello, I have a question about limiting users to a direcotry,
> basically I want to limit the users to a certain directory. ie: user1
> would be limited to browsing user1's directory. Currently I am doing
> the following for each user in the htpasswd file:
>
> Alias /user1 "/export/home/user1"
> <Directory "/export/home/user1">
>      AuthName Admin
>      AuthType Basic
>      AuthUserFile /usr/local/apache1/conf/cliweb-passwd
>      Options None
>      AllowOverride None
>      Order allow,deny
>      Allow from all
>      require user user1
> </Directory>
>
> I was wondering if there's a faster way to do this, so that I don't
> have to create an entry for each user?

Something like this:
<Directory /export/home>
...
require valid-user
</Directory>
RewriteEngine On
RewriteCond %{LA-U:REMOTE_USER} (.+)
RewriteRule ^/(.*) /export/home/%1/$1

This actually hides the users' directory name, which may or not be
what you want.  Also be careful about what happens if REMOTE_USER is
empty.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
   "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux