Solution to the problem that the password cannot be used to log in to the Linux cloud server ECS

Problem Description

When using a password to remotely log in to an ECS instance through Workbench or SSH (such as PuTTY, Xshell, SecureCRT, etc.), I encounter an error that the password login method is disabled on the server .:

Possible Causes:

This problem is due to the fact that the parameters in the configuration file /etc/ssh/sshd_config corresponding to the SSH service PasswordAuthenticationare set to no, which means that password login to the ECS instance is prohibited and needs to be modified to yes.

solution:

You can solve the above problem by binding a key pair to the instance or modifying the SSH service configuration file after logging in to the instance through VNC based on business needs.

1. Log in to the ECS instance using VNC or binding a key pair.

For specific operations, see Binding SSH Key Pair or Connection Method Overview ECS Remote Connection Operation Guide .

2. Check whether /etc/ssh/sshd_configthe parameter PasswordAuthenticationconfiguration is incorrect.

cat /etc/ssh/sshd_config

As shown in the figure below, PasswordAuthenticationthe parameter is set to no, indicating that password login is prohibited and needs to be modified to yes.

3. The modified PasswordAuthenticationparameters are yes.

  • a. Open the SSH configuration file.

vi /etc/ssh/sshd_config

  • b. Will be PasswordAuthentication nomodified to PasswordAuthentication yes.
  • c. Press the Esc key and enter :wqto save changes.

3. Restart the SSHD service.

service sshd restart

After restarting, you can log in with your password.

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

Guess you like

Origin blog.csdn.net/qq_34383510/article/details/130906386