瀏覽代碼

Add the usage of fail2ban

Xi Ruoyao 7 年之前
父節點
當前提交
5e84f70df7
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      content/post/script-kid.md

+ 9 - 0
content/post/script-kid.md

@@ -54,3 +54,12 @@ guys are naive!  I can tell you I am angry.  What you are doing is useless.
 我今天是作为一个 ACMer 和你们讲。我不搞网络安全,但是我见得太多了。
 在网上搞事情还是要按照基本法!
 你们啊, naive ! I am angry 我和你讲,你们这样子是不行的。
+
+## Use Fail2Ban to stop the kids automatically
+
+Fail2Ban parses `/var/log/auth.log` to find the IPs keep trying to login
+via SSH and use `iptables` to ban them automatically.
+
+`sudo apt install fail2ban`, `systemctl enable fail2ban` and
+`systemctl start fail2ban`.  The default configuration can ban the brute
+force attack on SSH.