zoukankan      html  css  js  c++  java
  • 在Ubuntu 20.04 LTS Focal Fossa上安装Fail2ban

    步骤1.首先,通过apt在终端中运行以下以下命令,确保所有系统软件包都是最新的。
    sudo apt update
    sudo apt upgrade
    步骤2.在Ubuntu 20.04上安装Fail2ban。
    运行以下命令以安装Fail2ban:
    sudo apt install fail2ban
    完成后,Fail2ban服务将自动启动。您可以使用以下命令验证Fail2ban:
    sudo systemctl status fail2ban
    步骤3. Fail2ban配置。
    默认的fail2ban安装带有两个配置文件,/etc/fail2ban/jail.conf并且/etc/fail2ban/jail.d/defaults-debian.conf您可以了解更多关于监狱这里。要开始配置Fail2ban服务器打开,请使用nano编辑器打开jail.local文件:
    [DEFAULT]

    # "ignoreip" can be an IP address, a CIDR mask or a DNS host. Fail2ban will not
    # ban a host which matches an address in this list. Several addresses can be
    # defined using space separator.
    ignoreip = 127.0.0.1/8 ::1 123.123.123.123 192.168.1.0/24

    # "bantime" is the number of seconds that a host is banned.
    bantime = 2d

    # A host is banned if it has generated "maxretry" during the last "findtime"
    # seconds.
    findtime = 600
    maxretry = 5

    # Destination email address used solely for the interpolations in
    # jail.{conf,local} configuration files.
    destemail = admin@idroot.us
    sender = root@idroot.us
    重新启动Fail2ban服务以使更改生效:
    sudo systemctl restart fail2ban
    恭喜你!您已经成功安装了Fail2Ban。A5互联https://www.a5idc.net/

  • 相关阅读:
    C#学习(四)
    C#学习(三)
    sqlserver基本操作
    ado.net(1)
    wpf的学习日志(一)
    C#学习(二)
    三大范式
    存储过程
    事务
    范文模板
  • 原文地址:https://www.cnblogs.com/a5idc/p/13665053.html
Copyright © 2011-2022 走看看