Download the EPEL repository with the following command:
Install the Deny Hosts package with the following:
- sudo yum install denyhosts
You can further configure any settings in the DenyHosts.conf file by going to the following and updating according to your preference.
附上自己IP被锁解决办法:
解决:
1. 根据/usr/share/denyhosts/denyhosts.cfg 配置中的SECURE_LOG, 清空日志文件
比如 /var/log/secure。
>>:echo “” > /var/log/secure
2. 重置系统日志计数器。
>>:service rsyslog restart 或者是 service syslog restart
3. service denyhosts stop 停止服务。
4. /usr/share/denyhosts/data目录下的其它文件中关于hosts.deny中的IP记录一并清空
PS:data下所有文件都要检查。 一个都不能留。 否则无效。
5. service denyhosts start 启动服务。
6. 将hosts.deny中要解禁的IP删除,清理掉。
7. /usr/share/denyhosts/daemon-control restart 重启。 完毕。
上面一步都不能少
注:可以添加白名单, 如果没有allowed-hosts ,输入命令:echo ‘218.55.11.*’ >> /var/lib/denyhosts/allowed-hosts 添加一个. IP改成自己的.
沒有留言:
張貼留言