
VPS教程
上次有在"如何使用 fail2ban 和 FirewallD 黑名单保护你的系统"文章中记录到在centos系统镜像中安装和部署Fail2ban安全软件阻止SSH安全的策略。一般我们网站是没有安装的,我们可能 会通过修改端口、强密码,或者WEB服务器客户端的一些工具帮助设置安全。有些运维高手一般很少会使用第三方工具,而是直接在服务器端设置安全。
在前一篇文章中,记录到在centos系统中安装Fail2ban 的方法,这里顺带一并把在CentOS7/Debian/Fedora安装Fail2ban安全软件教程都记录下来,其实有些是相似的,但是鉴于以后可能会需要用到就一并整理出来。如果有需要的可以看看。
- dnf update
- dnf install fail2ban
- dnf install sendmail
- systemctl start fail2ban
- systemctl enable fail2ban
- systemctl start sendmail
- systemctl enable sendmail
我们可以看到基本的策略和前面看到的ubuntu差不多的,区别就在于命名稍微有点不同。
- apt-get update && apt-get upgrade -y
- apt-get install fail2ban
- apt-get install sendmail-bin sendmail
目前我们使用较多的CentOS版本还是从7开始,8虽然有但是我个人建议不要太用新的。有些软件兼容不是太好,以及对于服务器要求是比较大的。
- yum update && yum install epel-release
- yum install fail2ban -y
- yum install sendmail
- systemctl start fail2ban
- systemctl enable fail2ban
- systemctl start sendmail
- systemctl enable sendmail