服务器默认支持密码登录的,想禁止密码登录,如何操作:
操作步骤
1、编辑ssh服务配置文件:vi /etc/ssh/sshd_config。
vi /etc/ssh/sshd_config
2、修改PasswordAuthentication属性:将yes修改为no,保存退出。
yes表示允许密码验证,no表示禁用密码验证功能。
PasswordAuthentication yes/no
3、然后重启sshd即可
重启:systemctl restart sshd.service
查看:systemctl status sshd.service
启动:systemctl start sshd.service
自启:systemctl enable sshd.service
4、再次连接服务器,服务器已经禁止了密码登录。