1.进入到下面的文件夹
cd /etc/ssh/
输入指令 ll 查看目录下文件
2.先执行备份语句,
cp sshh_config ./sshd_config20230426001bak
3.编辑文件sshd_config
vi sshd_config
4.输入查询指令
先输入 /再输入PasswordAuthentication
完整内容如下
/PasswordAuthentication
按 n 查询下一个,找到后按 i 进入编辑 将 no 改为 yes
输入 :wq 保存退出
6.重启 sshd 服务
systemctl restart sshd