如何设置某个ip源发起的ssh请求不能使用密码验证
要设置某个IP源发起的SSH请求不能使用密码验证,可以通过以下步骤进行操作:
- 
编辑SSH服务器的配置文件:
sudo nano /etc/ssh/sshd_config - 
找到以下行并进行修改:
#PasswordAuthentication yes将其修改为:
PasswordAuthentication no - 
保存并关闭配置文件。
 - 
重新加载SSH服务器配置:
sudo service sshd reload - 
进入
/etc/hosts.deny文件,并添加以下行:sshd: <IP地址>将
<IP地址>替换为要禁止密码验证的IP地址。 - 
保存并关闭
/etc/hosts.deny文件。 
现在,该IP地址发起的SSH请求将不再允许密码验证。要连接到该SSH服务器,用户必须使用其他身份验证方法,如公钥身份验证。
原文地址: https://www.cveoy.top/t/topic/h68U 著作权归作者所有。请勿转载和采集!