Automatic blocking of remote IP hosts attacking ssh and other services

Script to record how many times system services are being probed, using configurable pattern matching to recognize failed accesses (such as for "sshd" or "proftpd" or any service), and when a particular IP address exceeds a certain number of failed attempts, that IP address is blocked by using multiple techniques: using /etc/hosts.allow for services that support TCP_WRAPPERS, or by executing ip route commands to setup null-routing for that source host address, or by executing iptables commands to setup packet filtering to drop packets from a source host address. Both IPv4 and IPv6 supported.

Requires python version 2.3, and runs on Unix-like machines only.

Script is most suitable for home Linux users, who need to keep ssh/ftp ports or other services open, and need to block the script kiddies. With null-routing or packet filtering, any service can be protected, since those mechanisms block at the IP routing or packet filtering level. In this case, the only requirement is that there should be a way to detect failed accesses in some system log file.

Also available: BlockHosts Forum and BlockHosts FAQ.


Recent updates go to this Montreal as a tourist Google+ Collection.

There is no city that is more inviting, fascinating, friendly, and exciting, than the city of Montreal.
From its museums, to its parks, to its bustling tourist areas like Ste Catherine, St Laurent, and St Denis, there is never a dull moment in Montreal. Even after visiting so many times, I always end up discovering something new on each visit. It does help me a lot that English is spoken everywhere here, since it takes all the fun out of traveling if one can't communicate with the locals.
(Of course, like France, Quebec is not very fond of English. Once in a while, out in the suburbs, you'll bump into someone who will rail at you for not speaking French. But the majority seems comfortable speaking English.)

In addition to being a major cosmopolitan city with many different communities living together, and having a collection of awesome ethnic restaurants, the people of Montreal are very friendly, and Montreal is also a very safe city -- there are no regions I am afraid of being in at any time of the day or night -- as long as there are other people around, I feel totally safe. Drunks are the only problems you may encounter.

Food in Montreal is always what gets me back there. I've eaten in numerous places; even when I'm on my own exploring restaurants, when such a policy is bound to end in tragic results in other cities, it is hard to escape bad food! Amazingly, even with just randomly choosing a restaurant, I have usually encountered excellent cuisine in Montreal.


In this section, it's all about memorable places I have visited, and like to visit again and again. And the focus is on food - where to get some good, local eats while traveling.

I thoroughly enjoy visiting cities, exploring all the streets and suburbs of a city, taking things very slow and just wasting time sitting on a city bench or a sidewalk cafe, spending all the time watching the local people go about with their daily duties. Then there is food - absolutely the best part of traveling is exploring restaurants of all types, and what draws me back to a place is usually the memory of particular foods - for example, Schwartz's in Montreal, Sal and Carmine's pizza in NYC, and the Taquerias in Mexico City. The food has to be unique and interesting, and the locals must also give it their vote of confidence. This means ignoring all the four/five star high-end tourist dining joints. These are actually risky since either bad food or bad service makes it all doubly disappointing, and secondly, all high-end places all over the world are alike. Why travel for those, travel should be for exploring and experiencing how others live and eat, in their daily routines.

I never make any definite plans about what I'll do when I get to a place - other than walk and eat, a strategy that works only in the truly memorable cities of the world.

Right now, I have two very favorite destinations -- Montreal, and any Latin America city. Montreal is just a six hour drive from Boston, so a a four-five day vacation is a sufficient excuse for me to try get to Montreal. And my fascination with Latin America and its people have given me my most important hobby -- I am trying to learn Spanish (sad to say, I have made little progress on that count even after multiple years of attending non-credit courses at the local school -- but that is ok, this is turning out to be a lifelong quest :-).

Moving to Drupal

After months at looking at various Content Management Systems, Blogging Tools, I've decided to move this site to Drupal.

All the links that most people use are available at the top of the left-sidebar on this page, those pages will continue to stay as they are.