type
Post
status
Published
date
Dec 2, 2023
slug
fail2ban
summary
给ssh服务添加fail2ban安全认证
tags
教程
Linux
category
Linux
icon
password
comment
  • 本文主要讲解在Linux系统中安装fail2ban服务来提供ssh服务的安全性。
  • fail2ban用来保护ssh的原理非常简单,主要就是通过检测ssh的日志,记录下频繁登录失败的IP,然后使用iptables来直接禁用掉这个IP对应的请求即可实现ssh的防暴力破解。

1.安装fail2ban

  • Red Hat系
  • Debian系
对于所有支持的操作系统,fail2ban 安装在 /etc/fail2ban 路径下。其配置文件 jail.conf 在同一文件夹下。但是,如果想对配置做出改变,不应直接修改 jail.conf ,代之一份本地拷贝文件进行修改:

2.配置fail2ban

  • Red Hat系
  • Debian系

3.重启服务

4.Ref.

 
圣诞小记搭建tailscale的derper中继
Loading...