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

相关推荐
一个不秃头的 程序员3 小时前
配置git仓库的地址
git
coderCatIce4 小时前
git(带流程图)
git
Jonathan Star5 小时前
git commit --amend 是 Git 中用于修改最后一次提交的核心命令
前端·chrome·git
超哥归来5 小时前
关闭vscode中git的行历史提示
ide·git·vscode·编辑器
修炼者6 小时前
如何让git识别不到你的文件
git·github
小猪佩奇TONY6 小时前
常用软件工具的使用(1) ---- git 的安装和基础操作
大数据·git·elasticsearch
小猪佩奇TONY6 小时前
常用软件工具的使用(2) ---- git 命令进阶 和 github
git·github
写代码的【黑咖啡】6 小时前
版本控制工具介绍及常用命令:Git 与 SVN 入门指南
git·svn
-借我杀死庸碌的情怀-6 小时前
强制重置本地分支到远程初始状态
git
愈努力俞幸运6 小时前
git,vscode,pycharm
git·vscode·pycharm