溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶(hù)服務(wù)條款》

fail2ban安裝配置

發(fā)布時(shí)間:2020-05-28 12:45:10 來(lái)源:網(wǎng)絡(luò) 閱讀:559 作者:yht_1990 欄目:安全技術(shù)

rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm

yum -y install fail2ban

sed -i "50s#ignoreip = 127.0.0.1/8#ignoreip = 127.0.0.1/8 113.108.131.85/24#" /etc/fail2ban/jail.conf

sed -i "59s#bantime  = 600#bantime  = 7200#" /etc/fail2ban/jail.conf

sed -i "63s#findtime  = 600#findtime  = 86400#" /etc/fail2ban/jail.conf

sed -i "129s/destemail = root@localhost/destemail = t891958201@126.com/" /etc/fail2ban/jail.conf

sed -i "216a enabled = true" /etc/fail2ban/jail.conf

sed -i "218a action   = iptables[name=SSH, port=ssh, protocol=tcp]" /etc/fail2ban/jail.conf

sed -i '219a sendmail-whois[name=SSH, dest=t891958201@126.com, sender=root@localhost, sendername="Fail2Ban"]' /etc/fail2ban/jail.conf

sed -i '220s#^#           #' /etc/fail2ban/jail.conf

sed -i "220a bantime  = 7200" /etc/fail2ban/jail.conf

sed -i "221a findtime  = 86400" /etc/fail2ban/jail.conf

sed -i "222a maxretry = 5" /etc/fail2ban/jail.conf

sed -i "230a enabled = true" /etc/fail2ban/jail.conf

sed -i "232a action  = iptables[name=ssh-ddos, port=ssh,sftp protocol=tcp,udp]" /etc/fail2ban/jail.conf

sed -i '233a sendmail-whois[name=SSH, dest=t1934844044@126.com, sender=root@localhost, sendername="Fail2Ban"]' /etc/fail2ban/jail.conf

sed -i '234s#^#           #' /etc/fail2ban/jail.conf

sed -i "234a bantime  = 7200" /etc/fail2ban/jail.conf

sed -i "235a findtime  = 86400" /etc/fail2ban/jail.conf

sed -i "236a maxretry = 5" /etc/fail2ban/jail.conf

service fail2ban start


向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI