B
B
by_EL2021-04-05 01:58:31
linux
by_EL, 2021-04-05 01:58:31

How to properly set up fail2ban for ssh that runs on a non-standard port?

I use a different port for ssh, I want to configure it so that everything works and is correct on fail2ban.
Thank you

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
hint000, 2021-04-05
@by_EL

Open the /etc/fail2ban/jail.conf file in a text editor
Find the section there:

[sshd]

# To use more aggressive sshd modes set filter parameter "mode" in jail.local:
# normal (default), ddos, extra or aggressive (combines all).
# See "tests/files/logs/sshd" or "filter.d/sshd.conf" for usage example and details.
#mode   = normal
port    = ssh
logpath = %(sshd_log)s
backend = %(sshd_backend)s

Replace port = ssh
with port = 12322.
Restart the fail2ban service.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question