Tencent Cloud/Alibaba Cloud/Linux server creation selects the key login password and cannot log in. How to solve the problem?
Summarize the following four steps:
1. Change password
Get permission first, switch first
sudo su - root
change root password
passwd root
2. Modify the file
vi /etc/ssh/sshd_config
Find the following 2 sections,
PasswordAuthentication yes
PermitRootLogin yes
The comment # in front of the above 2 lines needs to be deleted
3. Restart the sshd service
systemctl restart sshd.service
It's done in one go, ok to solve it.