SSH:Konfigurasi dengan Fail2ban: Difference between revisions

No edit summary
 
(5 intermediate revisions by the same user not shown)
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.
  nano /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 41: Line 42:


*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:
  sudo systemctl restart fail2ban.service
  sudo systemctl restart fail2ban.service


Line 46: Line 48:
*You can now test this functionality by re-enabling PasswordAuthentication in the OpenSSH Configuration file found in <code>/etc/ssh/sshd_config</code>. Do this by changing the value from no to yes using the text editor of your choice. Make sure these lines are uncommented.
*You can now test this functionality by re-enabling PasswordAuthentication in the OpenSSH Configuration file found in <code>/etc/ssh/sshd_config</code>. Do this by changing the value from no to yes using the text editor of your choice. Make sure these lines are uncommented.


#To disable tunneled clear text passwords, change to no here!
  #To disable tunneled clear text passwords, change to no here!
  PasswordAuthentication yes
  PasswordAuthentication yes
  PermitEmptyPasswords no
  PermitEmptyPasswords no
Line 53: Line 55:


==Source==
==Source==
*[https://bit.ly/3qdFXBX linode.com]
*[https://www.linode.com/docs/guides/how-to-use-fail2ban-for-ssh-brute-force-protection/ linode.com]


[[Category:Tutorial]]
[[Category:Tutorial]]
[[Category:Server]]
[[Category:Server]]
[[Category:Security]]
[[Category:Security]]