在禁用密码登录前,要先配置好免密登录,不然退出后你就上不去了
编辑远程服务器上的sshd_config文件:
vi /etc/ssh/sshd_config
PasswordAuthentication yes改为no
PasswordAuthentication no
编辑保存完成后,重启ssh服务使得新配置生效,然后就无法使用口令来登录ssh了
systemctl restart sshd.service
在禁用密码登录前,要先配置好免密登录,不然退出后你就上不去了
编辑远程服务器上的sshd_config文件:
vi /etc/ssh/sshd_config
PasswordAuthentication yes改为no
PasswordAuthentication no
编辑保存完成后,重启ssh服务使得新配置生效,然后就无法使用口令来登录ssh了
systemctl restart sshd.service