安装 目前库内的denyhosts版本为3.0 yum [color=rgb(0, 0, 136) !important]install -y denyhosts配置配置文件路径 vim /etc/denyhosts[color=rgb(0, 153, 0) !important].conf配置(yum安装时,大部分配置已写好,稍作改动即可) [color=rgb(0, 153, 0) !important]DENY_THRESHOLD_INVALID = [color=rgb(0, 102, 102) !important]5 [color=rgb(136, 0, 0) !important]#无效用户名限制登陆次数[color=rgb(0, 153, 0) !important]DENY_THRESHOLD_VALID = [color=rgb(0, 102, 102) !important]10 [color=rgb(136, 0, 0) !important]#有效用户名限制登陆次数[color=rgb(0, 153, 0) !important]DENY_THRESHOLD_ROOT = [color=rgb(0, 102, 102) !important]5 [color=rgb(136, 0, 0) !important]#root限制登陆次数[color=rgb(0, 153, 0) !important]AGE_RESET_ROOT = [color=rgb(0, 102, 102) !important]1d [color=rgb(136, 0, 0) !important]#root用户登录失败计数归零的时间[color=rgb(0, 153, 0) !important]ADMIN_EMAIL = root@localhost [color=rgb(136, 0, 0) !important]#管理员邮箱黑名单白名单 vim /etc/hosts[color=rgb(0, 153, 0) !important].denyvim /etc/hosts[color=rgb(0, 153, 0) !important].allowhosts.allow(hosts.deny同规则) sshd:*.*.*.*相关命令启动命令(yum安装,已默认配好) service denyhosts startservice denyhosts stopservice denyhosts status
加入自启动 chkconfig denyhosts on
|