在ssh
中, 默认是不允许使用password
认证的, 但是有时候, 我们需要使用password
认证.
为了能够实现这个功能, 我们需要对ssh
进行配置
解决方案
修改sshd
配置文件
修改/etc/ssh/sshd_config
文件, 将PasswordAuthentication
设置为yes
PasswordAuthentication no
重启ssh
服务
以下有两种方式, 选择一种即可
方式1: systemd
sudo systemctl restart sshd
方式2: service
sudo service sshd restart