git - ssh_exchange_identification: Connection closed by remote host 报错
天蓬老师
天蓬老师 2017-05-02 09:38:57
0
1
1469

github 莫名无法 push 代码,

报错:

fatal: unable to access 'https://***.git/': SSL peer handshake failed, the server most likely requires a client certificate to connect

重新按照官方文档生成ssh key。并添加后执行 ssh -T git@github.com 报错:
ssh_exchange_identification: Connection closed by remote host

执行ssh -vT git@github.com代码如下:

$ ssh -vT git@github.com
OpenSSH_6.9p1, LibreSSL 2.1.8
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to github.com [1.111.11.111] port 22.
debug1: Connection established.
debug1: identity file /Users/yangzhongjing/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/yangzhongjing/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/yangzhongjing/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/yangzhongjing/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/yangzhongjing/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/yangzhongjing/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/yangzhongjing/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/yangzhongjing/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.9
ssh_exchange_identification: Connection closed by remote host

这里面/Users/yangzhongjing/.ssh/id_rsa 这个文件是存在的。不知道为什么会报:key_load_public: No such file or directory

网上搜了很多执行了以下方法都没有效果:

  • vim /etc/hosts.allow 添加 sshd: ALL

  • ssh-add ~/.ssh/id_rsa

  • 调整了 /etc/ssh/sshd_config 中的 MaxSessions 10 调大

  • 删除 ~/.ssh目录重新生成ssh key

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

모든 응답(1)
大家讲道理

라우터 가속 플러그인 문제가 해결되었습니다..

최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!