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

相关推荐
李永奉17 小时前
Git和GitHub-用操作命令控制Git的工作区、暂存区、本地仓库之间状态的提交教程
git·github
羊在吃青草1 天前
Git之远程仓库
git
凉、介1 天前
Git 深入理解(二) | 常用命令
大数据·git·elasticsearch
xuxie992 天前
GIT版本管理
git
茶栀(*´I`*)2 天前
Git从零开始操作清单
git
李永奉2 天前
Git和GitHub-Git 管理的版本数据到底保存在哪个文件夹里?
git·github
Mortalbreeze2 天前
Git 基础篇(二):本地仓库管理与常用操作
git
武昌库里写JAVA5 天前
SpringBoot+Vue 项目介绍
java·javascript·git·sql·ai
Hvitur7 天前
Git - 多分支合并
git·github
考虑考虑7 天前
git刷新远程分支列表
git·后端·gitlab