ssh remote host identification has changed

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

The problem is that you've previously accepted an SSH connection to lớn 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 lớn SSH again or use github to lớn 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 lớn. 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 lớn tự 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 lớn quit and choose Y to lớn save changes

Now type ssh -p port servername and you will receive the original prompt you did when you first tried to lớn SSH to lớn that computer. You will then be given the option to lớn save that remote computer's updated SHA256 fingerprint to lớn 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