查看SSH登录日志

方法1:auth.log
查看/var/log/auth.log
方法2:lastb 命令
admin ssh:notty 206.255.245.229 Fri Apr 1 04:12 – 04:12 (00:00)
root ssh:notty 223.113.52.38 Fri Apr 1 04:03 – 04:03 (00:00)
root ssh:notty 223.113.52.38 Fri Apr 1 03:52 – 03:52 (00:00)
ubuntu ssh:notty 121.69.129.132 Fri Apr 1 03:45 – 03:45 (00:00)
root ssh:notty 223.113.52.38 Fri Apr 1 03:42 – 03:42 (00:00)
root ssh:notty 189.20.29.202 Fri Apr 1 03:30 – 03:30 (00:00)
root ssh:notty 121.69.129.132 Fri Apr 1 03:27 – 03:27 (00:00)
support ssh:notty 39.152.44.119 Fri Apr 1 00:22 – 00:22 (00:00)
support ssh:notty 39.152.44.119 Fri Apr 1 00:22 – 00:22 (00:00)

Fail2ban 通过扫描错误日志来禁止某些 IP 访问服务,它会直接修改防火墙规则来阻止来自这些 IP的请求。

沪ICP备15048782号-1