我知道类似的问题已经被问过很多次了,但这里有一个区别:
尝试从 cpanel 共享托管服务器克隆项目:
如果尝试使用此命令sudo git clone ssh://[email protected] /cdn-cgi/l/email-protection:21098/home/mlbrpkxs/unified.mlbranch.com
它显示以下错误。
Cloning into 'unified.mlbranch.com'...
Unable to negotiate with 63.250.38.32 port 21098: no matching host key type found. Their offer: ssh-rsa,ssh-dss
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
那么如果找到解决方案here https://stackoverflow.com/questions/34208495/unable-to-negotiate-with-xx-xxx-xx-xx-no-matching-host-key-type-found-their-of并尝试使用此命令进行克隆。
sudo GIT_SSH_COMMAND="ssh -oHostKeyAlgorithms=+ssh-dss" git clone ssh://[email protected] /cdn-cgi/l/email-protection:21098/home/mlbrpkxs/unified.mlbranch.com
Cloning into 'unified.mlbranch.com'...
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the DSA key sent by the remote host is
SHA256:hSIV2UEWbLuZQu2gkNaYNYxfmOd59VGlaNwXI85P+fA.
Please contact your system administrator.
Add correct host key in /var/root/.ssh/known_hosts to get rid of this message.
Offending RSA key in /var/root/.ssh/known_hosts:1
Host key for \[mlbranch.com\]:21098 has changed and you have requested strict checking.
Host key verification failed.
fatal: Could not read from remote repository.
我发现最相关的问题是here https://stackoverflow.com/questions/35233777/git-error-unable-to-negotiate-with-xx-xx-xxx-xxx-no-matching-host-key-type-fo,作为以下副本关闭this one https://stackoverflow.com/questions/20840012/ssh-remote-host-identification-has-changed它本身作为题外话而被关闭。但无论如何,它们并不相同。另一个相关问题被问到here https://osdir.com/.
据我们所知,在大多数情况下,您可以通过替换服务器密钥来解决问题,例如运行:
ssh-keygen -R <host>
就我而言:
ssh-keygen -R "[mlbranch.com]:21098"
但无论是这个解决方案,还是从文件中删除有问题的密钥~/.ssh/known_hosts
确实解决了我的问题。
我已经清理了 stackOverflow 的答案推荐的所有已知主机。现在我完全陷入困境,无法找到任何解决方案如何解决这个问题。
请注意,我使用的是 Mac book,我的代码位于使用 Cpanel 的共享主机上。在我的另一台 Mac 上我可以得到克隆。