换电脑没办法使用git 下载项目的问题
换了一台电脑,安装了新的git工具
生成id_rsa.pub,把id_rsa.pub的内容加入到账号的ssh配置里面
本以为一切顺利,不过一下载就遇见如下问题
The authenticity of host '。。。。' can't be established.
ED25519 key fingerprint is SHA256:k4ViHJBFryacGI+BqHphyjDBaRLwt5eSGRMJGt8CmV0.
This key is not known by any other names
git@192.168.3.252's password:
Permission denied, please try again.
git@192.168.3.252's password:
Permission denied, please try again.
git@192.168.3.252's password:
git@192.168.3.252: Permission denied (publickey,password).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
网上说的配置known_hosts文件,选yes通通不好用
经过仔细查看发现新版的加密算法由RSA变成了ED25519
所以他才会询问ED25519 key fingerprint is SHA256:k4ViHJBFryacGI+BqHphyjDBaRLwt5eSGRMJGt8CmV0.
让你确认服务器的ed25519公钥的指纹
而我们一直配置的都是RSA算法,比如名字也叫 id_rsa.pub,id_rsa
本地根本没生成过ed25519的公私钥,所以能通讯才怪
在git命令行执行生成ed25519的公私钥
ssh-keygen -t ed25519 -C "xxx@xx.com"
本地会生成id_ed25519.pub和id_ed25519两个文件
把id_ed25519.pub里面的内容配置到后台ssh里面
一切就顺利了

浙公网安备 33010602011771号