使用密码无法登录Linux云服务器ECS的解决方法

问题描述

使用密码通过Workbench或SSH方式(例如PuTTY、Xshell、SecureCRT等)远程登录ECS实例时,遇到服务器禁用了密码登录方式错误.:

可能原因:

该问题是由于SSH服务对应配置文件/etc/ssh/sshd_config中的参数PasswordAuthentication被设置为no,表示禁止以密码方式登录ECS实例,需要修改为yes

解决方案:

您可以根据业务需要,为实例绑定密钥对或通过VNC登录实例后,修改SSH服务的配置文件,来解决上述问题。

1.以VNC或绑定密钥对方式登录ECS实例。

具体操作,请参见绑定SSH密钥对连接方式概述ECS远程连接操作指南

2.查看/etc/ssh/sshd_config的参数PasswordAuthentication配置是否有误。

cat /etc/ssh/sshd_config

如下图所示,PasswordAuthentication参数设置为no,表示禁止以密码方式登录,需要修改为yes

3.修改PasswordAuthentication的参数为yes

  • a.打开SSH配置文件。

vi /etc/ssh/sshd_config

  • b.将PasswordAuthentication no修改为PasswordAuthentication yes
  • c.按Esc键,输入:wq保存修改。

3.重启SSHD服务。

service sshd restart

重启之后即可使用密码登录

From:https://help.aliyun.com/document_detail/469713.html?spm=a2c4g.25433.4.2.7f25693bIwP5jd&scm=20140722.H_469713._.ID_469713-OR_rec-V_1

猜你喜欢

转载自blog.csdn.net/qq_34383510/article/details/130906386