1

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.

theist
  • 1,229
  • 2
  • 10
  • 24

1 Answers1

4

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 192.168.1.1

This will block everyone except 192.168.1.1 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 192.168.1.1
Allow from all
matthew
  • 1,319
  • 1
  • 11
  • 21