问题:
最近在配置局域网的git的时候,遇到Git访问仓库出现Permission denied (keyboard-interactive,publickey)的问题,试了好久,终于找到问题所在:
- GIT 2.33.1版本集成了最新的OpenSSH v8.8p1版本,此版本放弃了历史相当悠久的rsa-sha1的支持。
Administrator@F-PC MINGW64 /c/workspace
$ git clone Android@192.183.3.177:repos/StampWiki
Cloning into 'StampWiki'...
The authenticity of host '192.183.3.177 (192.183.3.177)' can't be established.
ECDSA key fingerprint is SHA256:Q86ILdzsxc1P6yPlN5xZ2rRd4XUoe53ov6KjqqmDZmk.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.183.3.177' (ECDSA) to the list of known hosts.
Android@192.183.3.177: Permission denied (publickey,keyboard-interactive).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
解决办法:
可以在密钥所在的.ssh目录下的config文件(没有的话自行创建)添加如下配置即可访问。
Host 192.183.3.177(这里替换为git主机的ip地址)
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedAlgorithms +ssh-rsa
然后问题就解决了。
Administrator@F-PC MINGW64 /c/workspace
$ git clone Android@192.183.3.177:repos/StampWiki
Cloning into 'StampWiki'...
remote: Enumerating objects: 2345, done.
remote: Counting objects: 100% (2345/2345), done.
remote: Compressing objects: 100% (1540/1540), done.
Receiving objects: 100% (2345/2345), 18.32 MiB | 5.98 MiB/s, done.
remote: Total 2345 (delta 1191), reused 1020 (delta 487)
Resolving deltas: 100% (1191/1191), done.