Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a large list of tor servers, maybe 2,000+ servers that I would like to ban from registering accounts on my site. Is it viable to block the entire list I have in an .htaccess file or will this cause the server to slow down in the same way having thousands of hosts in iptables will?

Is there another alternative? I have captcha already but bots aren't the problem. The problem is users using tor to circumvent bans.

share|improve this question

migrated from superuser.com May 27 '12 at 14:25

This question came from our site for computer enthusiasts and power users.

    
What OS is your server running? –  Paul May 27 '12 at 13:42
    
i think freenode blocks tor, you might ask on the moderators forum how they do it –  Tom H May 27 '12 at 14:33
    
my OS is centOS. Since I only needed this block for the registration page, what I did was this: when someone tries to go to the create account page, it redirects them to a page that checks their IP against a list of 4000+ tor entry/exit nodes and if it doesn't match, sets a session that allows them to register an account. –  Tar May 28 '12 at 4:37

1 Answer 1

You can use your htaccess file

order deny,allow
deny from x.x.x.x
deny from x.x.x.
allow from all

The alterative (and probably best) way is adding a DROP rule in your iptables firewall, which will keep the IP addressess away from your server.

share|improve this answer

Your Answer

 
discard

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.