FreeBSD Ports

security/denyhosts 3.1.2_1

Script to thwart ssh and imap attacks

Repository
FreeBSD ports
Maintainer
[email protected]
License
GPLv2
Categories
security
Package size
81.3 KiB, 392.4 KiB installed

Description

DenyHosts is a utility developed by Phil Schwartz and maintained by a number of developers which aims to thwart sshd (ssh server) brute force attacks.

If you've ever looked at your ssh log (/var/log/auth.log) you may be alarmed to see how many hackers attempted to gain access to your server. Denyhosts helps you:

  • Parses /var/log/auth.log to find all login attempts
  • Can be run from the command line, cron or as a daemon (new in 0.9)
  • Records all failed login attempts for the user and offending host
  • For each host that exceeds a threshold count, records the evil host
  • Keeps track of each non-existent user (eg. sdada) when a login attempt failed.
  • Keeps track of each existing user (eg. root) when a login attempt failed.
  • Keeps track of each offending host (hosts can be purged)
  • Keeps track of suspicious logins
  • Keeps track of the file offset, so that you can reparse the same file
  • When the log file is rotated, the script will detect it
  • Appends /etc/hosts.allow
  • Optionally sends an email of newly banned hosts and suspicious logins.
  • Resolves IP addresses to hostnames, if you want

Install

As a binary package — by origin, or by package name:

pkg install security/denyhosts
pkg install denyhosts-py312

From the ports tree:

cd /usr/ports/security/denyhosts/ && make install clean

To depend on this port in another port's Makefile:

RUN_DEPENDS=	denyhosts-py312>0:security/denyhosts

Packages

The version each package repository carries. “-” means the repository builds no package of it, “n/a” that there is no such repository.

Repositoryaarch64amd64armv6armv7i386
FreeBSD:14:latest3.1.2_13.1.2_13.1.23.1.2_13.1.2_1
FreeBSD:14:quarterly3.1.2_13.1.2_1n/a3.1.2_13.1.2_1
FreeBSD:15:latest3.1.2_13.1.2_1n/a3.1.2_13.1.2_1
FreeBSD:15:quarterly3.1.2_13.1.2_1n/an/an/a
FreeBSD:16:latest3.1.2_13.1.2_1n/an/an/a
FreeBSD:16:quarterlyn/an/an/an/an/a

Dependencies

As this port's Makefile names them.

Build 2

Runtime 1

The full lists below include those, and their dependencies in turn.

All build dependencies 16
All run dependencies 8

No port depends on this one.

Configuration

No options to configure.

USES
cpe python shebangfix
Service scripts
denyhosts

Message after installing

To run denyhosts from startup, add denyhosts_enable="YES"
in your /etc/rc.conf.
Configiration options can be found in /usr/local/etc/denyhosts.conf

In order to proper working of denyhosts
1. edit your /etc/hosts.allow file and add:
sshd : /etc/hosts.deniedssh : deny
sshd : ALL : allow
2. issue the following command if /etc/hosts.deniedssh does not exist yet
touch /etc/hosts.deniedssh

Warning:

syslogd should ideally be run with the -c option; this will ensure that
denyhosts notices multiple repeated login attempts.

To do this, add syslogd_flags="-c" to /etc/rc.conf

Files

distinfo 1
FileSizeSHA256
DenyHosts-3.1.2.tar.gz53086cfae79a11ce27e0e8a7a9915139d4c6b68df1022e447432d589e8fbb8e1aa9e7
Master sites 1
  • https://github.com/denyhosts/denyhosts/releases/download/v${PORTVERSION:R}/

Commit history 0

No commits in the history this site was built from.