0

I am running sshd on more than one port, say 22 and 2222.

I have installed sshguard to the system. How can I configure it to guard against attacks on all the ports defined in sshd's configuration?

Note: I am using UFW and the ssh ports are open to public IPv4 and IPv6.

1 Answer 1

0

It turns out that the ports to be filtered are defined in the line ending with sshguard in the file /etc/ufw/before.rules:

$ sudo grep -C1 :sshguard /etc/ufw/before.rules
# hand off control for sshd to sshguard
:sshguard - [0:0]
-A ufw-before-input -p tcp --dport 22 -j sshguard

So, editing the line ending with sshguard, like this, should do the trick:

-A ufw-before-input -p tcp -m multiport --dports 22,2222 -j sshguard


However, I haven't found a similar entry for IPv6.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .