github重新設置RSA

git push時遇到問題:

$ git push origin master
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
SHA256:uNiVztxxxxxxxxxxxxxxxxxxxxxxxxxCvj3tD2s.
Please contact your system administrator.
Add correct host key in /c/Users/mdzz/.ssh/known_hosts to get rid of this messae.
Offending RSA key in /c/Users/mdzz/.ssh/known_hosts:1
RSA host key for github.com has changed and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

首先進到github把現有的SSH keys>Authentication Keys刪除了,然後遵循官網的教程(在刪除key的位置有引導鏈接),在本地生成新的rsa密匙對,然後在本地某個文件夾下會多出xxx和xxx.pub,把xxx.pub的內容添加到github上去。然後重新git push,發現問題還是存在。於是到xxx和xxx.pub同一文件夾下,把known_hosts刪除了,重新git push這次成功,並且會重新生成known_hosts。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章