一个伪linux粉丝的blog

  1. 首页
  2. unix/linux
  3. 正文

centos fail2ban

21 5 月, 2020 929点热度 0人点赞 0条评论

前面登录新的 vps 的时候提示几千次失败登录,才想起没有做最简单的防护,安装debian下常用的denyhosts,结果centos提示没找到,不折腾,换不常用的fail2ban吧。

  • 安装

yum install epel-release -y
yum install fail2ban fail2ban-systemd -y

  • 配置ssh屏蔽文件
    1. /etc/fail2ban/jail.conf ## fail2ban 防护配置文件 这个里面设置太多,先整今天需要的ssh屏蔽就够了

在/etc/fail2ban/jail.d 目录下新建jail.local文件并配置。
[sshd]
enabled = true
port = ssh
#action = firewallcmd-ipset
logpath = %(sshd_log)s
maxretry = 3
bantime = 86400

  • 配置开机启动并启动

systemctl enable fail2ban
systemctl start fail2ban

    • 检查战况,蛋疼搞破坏的人真不少。

fail2ban-client status  sshd

  • 万一被误封,解封命令

fail2ban-client set sshd 123.*.*.* 要解封的ip

相关文章:

  1. Replacing OpenSSH server with dropbear
  2. crontab log error
  3. centos vps服务优化
  4. vmware-centos-lvextend-disk
标签: fail2ban
最后更新:22 5 月, 2020

wanjie

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >

文章评论

razz evil exclaim smile redface biggrin eek confused idea lol mad twisted rolleyes wink cool arrow neutral cry mrgreen drooling persevering
取消回复

This site uses Akismet to reduce spam. Learn how your comment data is processed.

归档
分类
  • network / 332篇
  • Uncategorized / 116篇
  • unix/linux / 122篇
  • 业界资讯 / 38篇
  • 公司杂事 / 11篇
  • 数码影像 / 12篇
  • 美剧 / 3篇
  • 美图共赏 / 21篇
  • 英语学习 / 3篇
标签聚合
职责 Nginx VPS kernel Google Voice gitlab ldap k8s 网站运营 squid postgres iMac Linux Google 虚拟主机 邮件归档 deepseek brew nexus 泰国 刷机 网通 d90 dreamhost空间 Ubuntu dreamhost unveiled today 天翼live docker webhook

COPYRIGHT © 2008-2025 wanjie.info. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang