Apache2 setup with mod_userdir and mod_authnz_external and pwauth, so that each user can access their home and can be authenticated by their local UNIX credentials.
Now I need some kind of authorization so that each user can, after being authenticated, only access their own home directory, but not those of other users.
The caveat: in my setup, a user is not necessarily the owner of their home directory, so mod_authz_owner won't work here.
Another problem: %{REMOTE_USER} variable set by Apache is not usable inside <If > directives (or other directives that might help here), because the authentication is done late during request processing.
How can I achieve my goal with Apache2? Is there e.g. the possibility to extract the user home directory name from %{REQUEST_URI} and pass it to a Require user ... directive? I have not been able to find out how to do this, so any help would be appreciated.
alias /home/$remote_user/;. Still, would be interesting if this was possible with Apache as well.