I have a rule like this in my jail.local file:

[ssh-ddos]

enabled = true
port    = ssh,sftp
filter  = sshd-ddos
logpath  = /var/log/messages
maxretry = 4

If I want to use a custom port for SSH, does Fail2ban automatically infer it from my sshd_config file or should I specify the port numerically?

link|improve this question

feedback

1 Answer

up vote 2 down vote accepted

You must specify the custom port in the [ssh] section, something like this:

[ssh]
port=2317
link|improve this answer
Thanks, wanted to double check. Thought it might read the sshd_config (that'd be sweet). – Trent Scott Oct 3 '11 at 0:24
It reads /etc/services for standard port names. – Selivanov Pavel Dec 6 '11 at 22:30
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.