Record Tencent Cloud Server to solve the login report: WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED problem

origin

I have two Tencent Cloud accounts in my hand, and a cloud server is linked to each account. Before, I could log in through ssh on the Mac Terminal terminal. Today, I found that one of them reported the following error: First, let’s talk about the solution
insert image description here
:
See There is such a sentence in the error message (here everyone’s hostname is different, you need to pay attention):

Add correct host key in /Users/hostname/.ssh/known_hosts to get rid of this message.

Then open the local terminal: vi /Users/hostname/.ssh/known_hosts
insert image description here
to delete the key value corresponding to the external network ip.
Then log in to the corresponding ip through ssh again, and report an error:

Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).

At this time, you need to modify a configuration on the corresponding server. The method is as follows:
1. One-click login through the terminal on the Tencent Cloud server
insert image description here
2. Vim /etc/ssh/sshd_config Modify the PasswordAuthentication yes in the sshd_config file
insert image description here
3. Execute: /bin /systemctl restart sshd.service
4. Reset the password
insert image description here
You should be able to log in with ssh here.

The reason behind the investigation is that I redid the system before and made a remote connection again. After entering yes, this machine will write the information of the remote machine to the /Users/hostname/.ssh/known_hosts file. Need to delete first, and then reset the password.

Guess you like

Origin blog.csdn.net/qq_40342691/article/details/122109793