ssh 设置只使用密码进行登陆
要设置只使用密码进行SSH登录,可以按照以下步骤进行操作:
- 打开SSH配置文件:
sudo nano /etc/ssh/sshd_config
- 在文件中找到和修改以下行:
#PasswordAuthentication yes
将其修改为:
PasswordAuthentication yes
-
保存并关闭文件。
-
重新加载SSH服务:
sudo systemctl reload sshd
现在,只能使用密码进行SSH登录。请确保密码设置足够强大以确保安全性。
原文地址: https://www.cveoy.top/t/topic/hLbh 著作权归作者所有。请勿转载和采集!