Jump to content

How to install SSHGuard in FreeBSD


Recommended Posts

  • Premium

Hello, in order to protect our machine against Brute Force attacks, we will use the sshguard.

I will be quick:

cd /usr/ports /security/sshguard -pf
make install clean ; rehash

The sshguard works by reading the log files.Will also protect our server form:

sendmail, exim, dovecot, cucipop, UWimap bruteforce attacks
proftpd, vsftpd, pure-ftpd, FreeBSD ftpd bruteforce attacks

To configure sshguard, edit the file in "/etc/pf.conf" and add the following lines:

table <sshguard> persist
block in quick on $ext_if proto tcp from <sshguard> to any port 22 label "SSH bruteforce atempt"

After, edit the file "/etc/syslog.conf" and add the following line:

auth.info;authpriv.info |exec /usr/local/sbin/sshguard

Now restart the syslog service:

/etc/rc.d/syslogd restart

To check if the IP of the attacker is added to the table sshguard viewing PF Firewall:

pfctl -Tshow -tsshguard

SSHGuard project:
http://www.sshguard.net/

  • Love 7
Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...
  • 1 month later...
  • 2 weeks later...

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.