Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to restrict certain user from a BasicAuth configured system to come only from certain IP address but allow the rest to come from anywere.

I know that I can restrict access using Deny and Allow directives and know also how to restrict access to users using Require. But I need a mix of both and I don't have a clue.

share|improve this question
up vote 4 down vote accepted

You need to use the Satisfy directive. I believe it would look something like this:

AuthUserFile /path/to/File
AuthName "Go away"
AuthType Basic
Require valid-user

Satisfy any
Order allow,deny
Deny from all
Allow from

This will block everyone except unless they enter a password.

If you only want to make the one IP enter the password and allow everyone else with no restrictions then it would be:

Satisfy any
Order allow,deny
Deny from
Allow from all
share|improve this answer

Your Answer


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.