av激情亚洲男人的天堂国语,日韩欧美精品一中文字幕,无码av一区二区三区无码,国产又色又爽又刺激的a片,国产又色又爽又刺激的a片

centOs下DenyHosts的安裝和使用方法

DenyHosts是Python語言寫的一個程序,它會分析sshd的日志文件(/var/log/secure),當發(fā)現(xiàn)重 復的攻擊時就會記錄IP到/etc/hosts.deny文件,從而達到自動屏IP的功能,下面為大家分享一下centOs下DenyHosts的安裝和使用方法。

下載DenyHosts包

[root@localhost ~]# wget http://jaist.dl.sourceforge.net/project/denyhosts/denyhosts/2.6/DenyHosts-2.6.tar.gz

安裝DenyHosts

[root@localhost ~]# tar xf DenyHosts-2.6.tar.gz
[root@localhost ~]# cd DenyHosts-2.6
[root@localhost DenyHosts-2.6]# python setup.py install

制作配置文件

[root@localhost DenyHosts-2.6]# cp denyhosts.cfg-dist /etc/denyhosts.cfg
[root@localhost DenyHosts-2.6]# cp daemon-control-dist daemon-control
[root@localhost DenyHosts-2.6]# chown root daemon-control
[root@localhost DenyHosts-2.6]# chmod 700 daemon-control

修改配置文件

將daemon-control中的#DENYHOSTS_CFG = “/usr/share/denyhosts/denyhosts.cfg”改為 DENYHOSTS_CFG = “/etc/denyhosts.cfg”

啟動

[root@localhost DenyHosts-2.6]# ./daemon-control start(注意相對路徑)

測試另外一臺服務(wù)器遠程連接172.16.1.16

默認允許五次,測試發(fā)現(xiàn)登陸失敗五次之后不允許登陸

[root@localhost ~]# ssh [email protected]
[email protected]'s password: Permission denied, please try again. [email protected]'s password:
Permission denied, please try again.
[email protected]'s password: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). [root@localhost ~]# [root@localhost ~]# ssh [email protected] [email protected]'s password:
Permission denied, please try again.
[email protected]'s password: Permission denied, please try again. [email protected]'s password:
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
[root@localhost ~]# ssh [email protected]
[email protected]'s password: Permission denied, please try again. [email protected]'s password:
Permission denied, please try again.
[email protected]'s password: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password). [root@localhost ~]# ssh [email protected] [email protected]'s password:
Permission denied, please try again.
[email protected]'s password: Permission denied, please try again. [email protected]'s password:
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
[root@localhost ~]# ssh [email protected]
ssh_exchange_identification: read: Connection reset by peer

查看hosts.deny文件

登陸連續(xù)失敗之后就會把ip地址寫在hosts.deny文件 172.16.1.112的ip已經(jīng)被限制,到此功能實現(xiàn)。


網(wǎng)頁名稱:centOs下DenyHosts的安裝和使用方法
網(wǎng)頁地址:http://uogjgqi.cn/article/dpccoii.html
掃二維碼與項目經(jīng)理溝通

我們在微信上24小時期待你的聲音

解答本文疑問/技術(shù)咨詢/運營咨詢/技術(shù)建議/互聯(lián)網(wǎng)交流