ssh remote host identification has changed

  • 13,000
  • Tác giả: admin
  • Ngày đăng:
  • Lượt xem: 13
  • Tình trạng: Còn hàng

The problem is that you've previously accepted an SSH connection to tướng a remote computer and that remote computer's digital fingerprint or SHA256 hash key has changed since you last connected. Thus when you try to tướng SSH again or use github to tướng pull code, which also uses SSH, you get an error. Why? Because you're using the same remote computer address as before but the remote computer is responding with a different fingerprint. Therefore, it's possible that someone is spoofing the computer you previously connected to tướng. This is a security issue.

If you're 100% sure that the remote computer isn't compromised, hacked, being spoofed, etc then all you need to tướng bởi is delete the entry in your known_hosts tệp tin for the remote computer. That will solve the issue as there will no longer be a mismatch with SHA256 fingerprint IDs when connecting.

On Mac here's what I did:

1) Find the line of output that reads RSA host key for servername:port has changed and you have requested strict checking. You'll need both the servername and potentially port from that log output.

2) Back up the SSH known hosts tệp tin cp /Users/yourmacusername/.ssh/known_hosts /Users/yourmacusername/.ssh/known_hosts.bak

3) Find the line where the computer's old fingerprint is stored and delete it. You can tìm kiếm for the specific offending remote computer fingerprint using the servername and port from step #1. nano /Users/yourmacusername/.ssh/known_hosts

4) CTRL-X to tướng quit and choose Y to tướng save changes

Now type ssh -p port servername and you will receive the original prompt you did when you first tried to tướng SSH to tướng that computer. You will then be given the option to tướng save that remote computer's updated SHA256 fingerprint to tướng your known_hosts tệp tin. If you're using SSH over port 22 then the -p argument is not necessary.

Any issues you can restore the original known_hosts file: cp /Users/yourmacusername/.ssh/known_hosts.bak /Users/yourmacusername/.ssh/known_hosts