Unix Review > Archives > 2005 > August 2005

UnixReview.com
August 2005

Tool of the Month: DenyHosts

by Joe "Zonker" Brockmeier

If you've ever looked through /var/log/secure or /var/log/auth.log (or whatever log file sshd logs to) on a public-facing system, you've probably noticed a number of failed login attempts for users that don't exist. Sometimes you'll even find dozens or even hundreds of failed login attempts — a sure sign that someone is attempting to access the system by brute-force attacks, trying to find a username and password combination that will give them access to your system.

If you use secure passwords, the odds of this succeeding are pretty slim — but why take chances? There are a number of things you can do to mitigate this problem — one is to block only a few known hosts to connect via SSH, but this means that you need to know where your users are going to be connecting from. This isn't always practical or possible.

Another approach is to have SSH listen on a non-standard port. I'm not a big fan of this approach, really, because it tends to complicate matters and causes problems for users when they're in an unfamiliar environment behind a firewall.

Another option is to block login attempts after a specific number of failed logins. That's where DenyHosts comes in. DenyHosts is a Python application that monitors the authentication logs and writes IPs to /etc/hosts.deny once a host exceeds the threshold for failed login attempts. At this point, the offending host cannot even attempt to authenticate via SSH until it is removed from /etc/hosts.d

Sys Admin Spotlight

CMP DevNet Spotlight

Christmas Chaos
Jerry shares his gift recommendations for tech-savvy friends and family.

In the News

CD-ROM

Sys Admin and The Perl Journal CD-ROM version 11.0

Version 11.0 delivers every issue of Sys Admin from 1992 through 2005 and every issue of The Perl Journal from 1996-2002 in one convenient CD-ROM!

Order now!




MarketPlace

Build IT Knowledge with Current & Trusted Content
Helps Employees Develop & Hone New Technical Programming Skills. Sign Up & Get Full Access.

Six Sigma Certification
100% Online-Six Sigma Certificate from Villanova - Find Out More Now.

Flowcharts from C/C++ code -- Free trial download
Understand C/C++ code in less time. A new team member ? Inherited legacy code ? Get up to speed faster with Crystal Flow for C/C++. Code-formatting improves readability. Flowcharts are integrated with code browser. Export flowcharts to Visio.

Discover WinDev 11 RAD
and develop 10 times faster ! ALM, IDE, .Net, PDF, 5GL, Database, 64-bit, etc. Free Express version

Wanna see your ad here?