【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。

相关推荐
Draw Stars9 小时前
Git BASH安装教程
开发语言·git·bash
Akiyama_Mio-Kon9 小时前
2026 最新:Dify 本地 Docker 部署完整教程(Windows + Git Bash)
windows·git·docker
福如意如我心意14 小时前
Git Worktree开发指南
git
Patrick_Wilson18 小时前
为什么gitlab的MR会默认有一个merge commit
前端·git·gitlab
是乐乐啊呀19 小时前
版本控制 GIT 和 SVN
git·svn
夜鸣笙笙1 天前
Git详细安装流程
git
瑞码空间1 天前
git知识点黄金笔记
笔记·git·elasticsearch
----云烟----1 天前
Git 提交忽略某些文件方法
git
切糕师学AI2 天前
如何查看已合并到 master 分支的所有分支?Git 分支清理指南
大数据·git·elasticsearch
DevUp2 天前
一个管「引」,一个管「抄」:Submodule 和 Subtree 到底差在哪
git·前端工程化