git push报错:WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

简介: git push报错:WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

目录

问题描述

使用git push 如往常一样推送代码,报错如下,开始以为是网络又出问题了,没有在意

过了很长时间,githu可以正常打开,不过代码还是推送失败,于是发现这个肯定是异常

$ git push
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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:uNiVztksCsDhxc0u1e8BujQXVUxKZIDTMczCvj3tD2s.
Please contact your system administrator.
Add correct host key in /Users/user/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/user/.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.

解决办法

将提示有问题的那一行删除

$ ssh-keygen -R github.com
# Host github.com found: line 1
/Users/user/.ssh/known_hosts updated.
Original contents retained as /Users/user/.ssh/known_hosts.old

重新推送代码,会有一些问题提示,都回答yes即可正常推送代码

参考文章


相关文章
|
9月前
|
安全 开发工具 git
git添加远程仓库报错To add an exception for this directory解决方案-优雅草卓伊凡
git添加远程仓库报错To add an exception for this directory解决方案-优雅草卓伊凡
852 5
git添加远程仓库报错To add an exception for this directory解决方案-优雅草卓伊凡
|
12月前
|
算法 安全 网络安全
git clone操作报错diffie-hellman-group1-sha1的解决方案
在处理这一问题时,需要确保了解相关操作的安全影响。`diffie-hellman-group1-sha1`算法被认为是不够安全的,这是因为随着计算能力的提高,`SHA-1`算法可以在合理的时间内被破解,而且其对应的 `1024位`Diffie-Hellman组也可能不够强大。因此,在确保Git操作的同时,也要考虑提升安全性的长期解决办法。强烈推荐与管理员或相关技术支持团队合作,升级和加强服务器端的安全配置。
314 12
|
网络协议 开发工具 git
解决 git 报错 “fatal: unable to access ‘https://github.com/.../.git‘: Recv failure Connection was rese
在使用 Git/Git小乌龟 进行代码管理的过程中,经常会遇到各种各样的问题,其中之一就是在执行 git clone 或 git pull 等操作时出现 “fatal: unable to access ‘https://github.com/…/.git’: Recv failure Connection was reset” 的报错。这个问题通常是由网络连接问题或代理设置不正确导致的。在我的个人使用经验中,我亲自尝试了四种方法,它们都能够有效地解决这个报错。个人比较推荐方法二。
9206 1
|
Shell 开发工具 git
解决git bash报错:在仓库中检测到可疑的所有权
总的来说,解决“在仓库中检测到可疑的所有权”的报错,关键在于理解和调整文件或目录的所有权。只要我们正确地设置了文件或目录的所有权,那么我们就可以避免这种问题,让Git Bash正常工作。
721 22
|
Linux 开发工具 git
解决 Linux git push 成功后(但没有出现绿点)的问题
最近学习使用Git,发现有时候在Linux下提交自己的小绿点并没有增加,单在仓库中却可以看到提交的代码。看着连续的绿点中出现几个零零散散的灰点,着实让一个强迫症患者十分难受。接下来分享以下我所知道的问题。
342 0
|
开发工具 git
git push报错:The current branch master has no upstream branch
git push报错:The current branch master has no upstream branch
41140 0
git push报错:The current branch master has no upstream branch
|
项目管理 开发工具 git
git push 报错 pre-receive hook declined
git push 报错 pre-receive hook declined
5917 0
git push 报错 pre-receive hook declined
|
存储 开发工具 git
使用 git push 上传超过100MB文件报错 remote: error: this exceeds GitHub‘s file size limit of 100.00 MB
Git 大文件存储(LFS)用 Git 中的文本指针替换音频示例、视频、数据集和图形等大文件,同时将文件内容存储在 GitHub.com 或 GitHub Enterprise 等远程服务器上。
1580 0
|
开发工具 git
完美解决git 执行git push origin master指令 报错command not found
完美解决git 执行git push origin master指令 报错command not found
781 0
|
开发工具 git
git push origin master提交报错解决办法
git push origin master提交报错解决办法
965 0