git - ssh_exchange_identification:連線被遠端主機關閉報錯
天蓬老师
天蓬老师 2017-05-02 09:38:57
0
1
1470

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學習者快速成長!