Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

1 Answer 1

up vote 3 down vote accepted

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

[ssh]
port=2317
share|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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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