【Git】Git配置 — 首次clone失败,出现报错:authenticity can‘t be established

项目场景:

在新安装的Ubuntu系统里使用git clone 项目


问题描述

安装完git,且已生成ssh秘钥,使用git clone 命令下载项目,出现了报错:

c 复制代码
AAA@pc-63:~/workspace/test$ git clone -b develop ssh://git@192.168.4.11/simulator/project.git
Cloning into 'project'...
The authenticity of host '[192.168.4.11]:2200 ([192.168.4.11]:2200)' can't be established.
ED25519 key fingerprint is SHA256:Mk3FECUgTt4dCOPbSieB1i6/yrWzk1HNflQYju8NF0M.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])?
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文件夹下缺少known_hosts文件


而实际应该是:

解决方案:

在出现"Are you sure you want to continue connecting ", 要选择yes。此时就可以正常clone。

相关推荐
胡琦博客2 小时前
如何同步远程分支到本地(远程有些分支已经删除了)
git
AI成长日志5 小时前
【实用工具教程】Git进阶:分支策略与合并冲突解决
git
ruanCat6 小时前
加了 .gitattributes 就万事大吉?我差点毁了整个团队的 Git 工作流
git
咋吃都不胖lyh7 小时前
查看 Git 本地仓库关联的远程仓库链接(URL)
git
wheelmouse77887 小时前
AI 时代的 Git 进阶术:如何优雅地让多个 Agent 并行开发
人工智能·git·ai编程
如意.75917 小时前
【Linux开发工具实战】Git、GDB与CGDB从入门到精通
linux·运维·git
用户9186861286871 天前
Git 版本控制完全指南:从入门到精通
git
简离1 天前
Git 一次性清理已跟踪但应忽略文件
前端·git
Drone_xjw1 天前
【环境搭建】Windows 10上使用Docker搭建本地Git仓库(Gitea)完整教程
windows·git·docker
疯狂成瘾者1 天前
git学习目录
git·学习