參考文章:
http://www.voidcn.com/article/p-fgknlkhg-sb.html
以及 github 文檔 https://github.com/denyhosts/denyhosts
具體步驟參考上面鏈接。建議直接使用他的安裝腳本,如果出現(xiàn)問題再自己折騰把。
我這邊是手動安裝的。
主要區(qū)別為:
1.自動安裝目錄不同
并不是網(wǎng)上說的/usr/share/denyhosts/
反正我的機子上壓根兒沒這個目錄生成,而是在/usr/bin/
所以cpoy文件改為:
cp /usr/bin/daemon-control-dist /usr/bin/daemon-control
2.配置文件中的監(jiān)控日志不同
由于我之前把登陸日志修改了,因此SECURE_LOG要修改為你對應的日志
daemon-control文件的注釋里說,不清楚具體在哪里文件中就寫為SECURE_LOG: [/var/log/*]
親測并不靠譜
Can't read: /var/log/*
[Errno 2] No such file or directory: '/var/log/*'
Error deleting DenyHosts lock file: /run/denyhosts.pid
[Errno 2] No such file or directory: '/run/denyhosts.pid'