Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

How can I set htpasswd prompt for everyone who want to access some server except people from LAN (192.168.0.*) ?

Thanks for the answers !

share|improve this question
up vote 4 down vote accepted

someting like this :

                    Order allow,deny
                    AuthType Basic
                    AuthName "Only for administrator"
                    AuthUserFile /etc/apache2/passwords/admin.pwd
                    AuthGroupFile /dev/null
                    Require valid-user
                    Allow from 192.168.10 10.8.0
                    Satisfy Any


share|improve this answer
Ok, works fine ! Instead of your Allow from 192.168.10 10.8.0 ... it should be Allow from 192.168. – hsz Jan 29 '10 at 11:33

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.