git中ssh推送出错解决方法 Warning: Permanently added 'gitee.com,120.55.226.24' (ECDSA) to the list of known hosts.
git使用ssh方式推送文件时出现如下错误解决方法:
Warning: Permanently added 'gitee.com,120.55.226.24' (ECDSA) to the list of known hosts.Bad packet length 1550728593.
ssh_dispatch_run_fatal: Connection to 120.55.226.24 port 22: Connection corrupted
fatal: Could not read from remote repository.
复制代码
错误原因:没有公钥
第1步:创建SSH Key。在windows下查看[c盘->用户->自己的用户名->.ssh]下是否有id_rsa、id_rsa.pub文件,如果没有需要手动生成。 打开git bash,在控制台中输入以下命令。
$ ssh-keygen -t rsa -C "github用户名"
复制代码

当使用git通过ssh方式推送时遇到'Warning: Permanently added 'gitee.com'到已知主机列表'的问题,主要是因为缺少公钥。解决方案包括检查C盘用户文件夹下的.ssh目录,如果没有id_rsa和id_rsa.pub文件,则需要生成SSH Key。在Windows的git bash中,可以运行相关命令来创建。
最低0.47元/天 解锁文章
4万+

被折叠的 条评论
为什么被折叠?



