问题描述
使用ssh认证模式,连接gitlab服务器,执行git pull报如下错误:
$ git pull
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: POSSIBLE DNS SPOOFING DETECTED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The RSA host key for gitlab.alibaba-inc.com has changed,
and the key for the corresponding IP address 10.10.31.61
is unknown. This could either mean that
DNS SPOOFING is happening or the IP address for the host
and its host key have changed at the same time.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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
xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx.
Please contact your system administrator.
Add correct host key in /Users/xx/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/xx/.ssh/known_hosts:7
RSA host key for gitlab.xxx.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.
解决方案
1. 删除~/.ssh/known_hosts 文件中包含"gitlab.xxx.com"这一行的记录
2. 删除~/.ssh/known_hosts整个文件
3. 修改open ssh配置文件,安全级别调低(不推荐,仅限内网等安全级别较高的环境,公网不要使用)
SSH对主机的public_key的检查等级是根据StrictHostKeyChecking变量来配置的。可以通过降低安全级别的方式,来减少这一类提示。
修改方法:
编辑~/.ssh/config(代表个人配置,或/etc/ssh/ssh_config,代表全局配置)
添加以下行
StrictHostKeyChecking no
UserKnownHostsFile /dev/null # 为了更简化,把known_hosts也省略掉了
下面附上StrictHostKeyChecking配置项的说明。
- StrictHostKeyChecking=no
最不安全的级别,当然也没有那么多烦人的提示了,相对安全的内网测试时建议使用。如果连接server的key在本地不存在,那么就自动添加到文件中(默认是known_hosts),并且给出一个警告。
- StrictHostKeyChecking=ask
默认的级别,就是出现刚才的提示了。如果连接和key不匹配,给出提示,并拒绝登录。
- StrictHostKeyChecking=yes
最安全的级别,如果连接与key不匹配,就拒绝连接,不会提示详细信息。
分享到:
相关推荐
title: Git提示Host key verification failed- 报错- 报错问题描述Git提示Host key verification f
简单记录了CENTOS6中GIT安装,ssh-keygen生成,客户端使用TortoiseGit加载KEYGEN连接GIT服务器的过程。
解决的问题为 git 配置多个ssh key 我们配置好两个 sshkey 后 分别为两个 如果是 github.com gitlab.com gitee.com 这三个当然没有问题 开发此工具碰到的问题是 开发者碰到同一代码托管平台 来自多个账号的 sshkey ...
git+ssh ubuntu 安装配置笔记 已经测试通过
Git采用SSH协议创建远程仓库,并把本地工程上传到远程仓库
sshkey 是放在服务器端,这样pull commit push就无需输入密码,这里提供个教程
ssh的互信,git服务器的配置,测试拉代码
git教程,看完之后git基本操作完全了解
git配置ssh免密登录.doc
主要介绍了git中ssh key配置详解,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
Windows下搭建基于ssh的git服务器
webpack构建完成后自动推送到指定分支,仅支持 git ssh 方式进行连接
Git-Eclipse使用已配置好的远程仓库中的项目SSH,要先注册码云,使用的eclipse
最近项目框架有所改变需要用到git,然后大概看了下,就总结一下,很简单的操作了,不过还是觉得总结一下,比较好,形成总结的好习惯,是有好处的啦
利用git时需要配置ssh,这里的文档清晰的描述了
gitBash 客户端 ssh 服务器远程登陆神器 Git-2.15.0-64-bit
。。。
。。。
资源为图文讲解,weblogic+ssh+git升级远程项目,文档步骤很详细,
git-multi-ssh.sh ssh为git命令部署密钥管理器(例如:对于github上的私有子模块)用法export GIT_SSH=git-multi-ssh.sh 并将环境变量设置为DEPLOY_KEY_[name]=[private-key] 当存储库ssh url为git@github....