VPS上取消密钥ssh登录

By | 2019-11-12

一些VPS为了安全考虑,都会限制用户必须使用ssh key进行登录,这样是安全但真的太不方便了!

例如: GCP、ODO等等大型VPS供应商,默认创建实例时都要求使用密钥登录

要取消比较容易,只需要按以下修改 /etc/ssh/sshd_config

修改:

PermitRootLogin   yes    这是让root用户远程登录

PasswordAuthentication  yes    这是使用密码登录

增加:

RSAAuthentication   no     取消RAS密钥登录

 

最后重启ssh服务

/etc/init.d/./ssh restart

發佈留言