我是第一次做git pull并且在git中提示无法建立主机的真实性,与我生成的私钥相比,RSA密钥指纹不正确.我只是想知道如何更新它,以便它读取正确的文件,为什么它首先读取错误的指纹?
vij*_*jay 17
我有类似的问题,这意味着远程主机是未知/不可信的.修复方法是在known_hosts文件中包含远程主机条目.
这就是我所做的:
生成(或使用现有的)RSA密钥并将其存储在<USER.HOME>/.ssh
文件中.如果您使用的是eclipse,则可以使用Preferences生成RSA密钥;
Generate RSA Key...
Save Private Key...
在.ssh文件夹中现在你<USER.HOME>/.ssh
将包含文件; 私钥,公钥和known_hosts
ssh -vt <user>@<hostname>
现在,如果您尝试将文件推送到远程,则不会看到任何错误.
sli*_*wp2 11
将 ssh 密钥添加到 GitLab 后,当您尝试克隆存储库时,如果Enter直接按键盘,您将收到以下错误:
Cloning into 'hfe-insure-m'...
The authenticity of host 'git.zhonganinfo.com (100.112.23.182)' can't be established.
ECDSA key fingerprint is SHA256:IRLOr2bTvVB2rLgYVgyUibE+oLlZ0pUwU9wycc/5zYU.
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.
Run Code Online (Sandbox Code Playgroud)
当你看到下面这句话时,请务必输入yes
,不要Enter直接按键盘。
您确定要继续连接吗(是/否/[指纹])?是的
例如
Cloning into 'hfe-insure-m'...
The authenticity of host 'git.zhonganinfo.com (100.112.23.182)' can't be established.
ECDSA key fingerprint is SHA256:IRLOr2bTvVB2rLgYVgyUibE+oLlZ0pUwU9wycc/5zYU.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'git.zhonganinfo.com,100.112.23.182' (ECDSA) to the list of known hosts.
remote: Enumerating objects: 31607, done.
remote: Counting objects: 100% (31607/31607), done.
remote: Compressing objects: 100% (10365/10365), done.
remote: Total 31607 (delta 20695), reused 31485 (delta 20604)
Receiving objects: 100% (31607/31607), 21.51 MiB | 581.00 KiB/s, done.
Resolving deltas: 100% (20695/20695), done.
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
54781 次 |
最近记录: |