文章目录 1. 最近简单的办法,(但是很少用到)2.通过脚本进行屏蔽IP3.设置公钥登录4.还有第三方软件(fail2ban) 1. 最近简单的办法,(但是很少用到) 定期关闭 sshd 的服务 [root@localhost ~]# crontab -e -u root //-e:编辑计划任务;-u:指定用户 30 7 * * * /etc/init.d/sshd start //每天早上7:30启动sshd服务 30 23 * * * /etc/init.d/sshd stop //每天晚上23:30关闭sshd服务 2.通过脚本进行屏蔽IP 这个拼搏会屏蔽该IP的所有功能 3.设置公钥登录 4.还有第三方软件(fail2ban)