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。

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