Github通过sshkey的方式拉取代码报错kex_exchange_identification

Git生成密钥 设定Git的username和email git config --global user.name "你的用户名" git config --global user.email "你的邮箱" 创建SSH key cd ~/.ssh ssh-keygen -t rsa -C "你的邮箱" 会出现以下的提示 Generating public/private rsa key pair. Enter file in which to save the key (~/.ssh/id_rsa): 一路回车默认就可以了,这样你的公钥和私钥就同时保存在了~/.ssh/下了。 获取SSH key cat id_rsa.pub Github添加SSH key 以上都配置了还不行就执行这一步 将 Github 的连接端口从 22 改为 443 即可 编辑 ~/.ssh/config 文件(没有就新增),windows在用户目录下的.ssh目录,添加如下内容 Host github.com HostName ssh.github.com User git Port 443 验证: ssh -T git@github.com 输出 Enter passphrase for key '~/....

March 26, 2024 · 1 min · ZhaoGuibin