跳转至

Git

使用github拉代码或者推代码的时候报错

kex_exchange_identification: Connection closed by remote host

跟使用了代理有关,解决方法是在~/.ssh/config中添加,把连接的端口从22改成443

Host github.com
    HostName ssh.github.com
    User git
    Port 443

验证

ssh -T git@github.com
# 输出
Enter passphrase for key 'C:\Users\Administrator/.ssh/id_rsa':
Hi happyjava007! You've successfully authenticated, but GitHub does not provide shell access.

评论