SSH:Konfigurasi dengan Fail2ban: Difference between revisions
No edit summary |
No edit summary |
||
| Line 1: | Line 1: | ||
*Begin by creating a new file within the same directory called jail.local. You can then add the necessary security configurations for the sshd jail. | *Begin by creating a new file within the same directory called jail.local. You can then add the necessary security configurations for the sshd jail. | ||
vim /etc/fail2ban/jail.local | vim /etc/fail2ban/jail.local | ||
*You can explore the options that Fail2Ban provides to customize the security and blocking of the SSH service. | *You can explore the options that Fail2Ban provides to customize the security and blocking of the SSH service. | ||
| Line 30: | Line 30: | ||
*With the information in table above you can create the jail.local configuration for OpenSSH server (sshd). Once you have entered the configuration options, the values used in this guide example are listed in the sample file below. | *With the information in table above you can create the jail.local configuration for OpenSSH server (sshd). Once you have entered the configuration options, the values used in this guide example are listed in the sample file below. | ||
[sshd] | [sshd] | ||
enabled = true | |||
port = ssh | |||
filter = sshd | |||
logpath = /var/log/auth.log | |||
maxretry = 3 | |||
findtime = 300 | |||
bantime = 3600 | |||
ignoreip = 127.0.0.1 | |||
*After you have specified the configuration options and their respective values, save the file and restart the Fail2Ban service with the following command: | *After you have specified the configuration options and their respective values, save the file and restart the Fail2Ban service with the following command: | ||
<syntaxhighlight lang="shell"> | <syntaxhighlight lang="shell"> | ||