ssh 不工作:远程主机关闭连接

ssh 不工作:远程主机关闭连接

我一直在使用 ssh 密钥,但有一天它突然停止工作了。这是我尝试克隆时得到的结果。此外,known_hosts 文件中没有任何内容。我该怎么办?

sarthak@Sarthak:~/.ssh$ git clone [email protected]:sarthmit/Andrew-Ng-ML-solutions.git
Cloning into 'Andrew-Ng-ML-solutions'...
ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

sarthak@Sarthak:~/Desktop/Web Scraping$ ssh -vvv [email protected]
OpenSSH_7.2p2 Ubuntu-4ubuntu2.2, OpenSSL 1.0.2g  1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "github.com" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to github.com [192.30.253.113] port 22.
debug1: Connection established.
debug1: identity file /home/sarthak/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/sarthak/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/sarthak/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/sarthak/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/sarthak/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/sarthak/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/sarthak/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/sarthak/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.2
debug1: ssh_exchange_identification: 

debug1: ssh_exchange_identification: 

debug1: ssh_exchange_identification: Error:  Must authenticate before using this service.


ssh_exchange_identification: Connection closed by remote host

答案1

debug1: Connecting to github.com [192.30.253.113] port 22.

这看起来不像是 github IP

debug1: ssh_exchange_identification: Error:  Must authenticate before using this service.

那不是 SSH 识别字符串。

您正在通过代理/防火墙进行连接,因此无法使用 SSH。您应该与网络管理员联系。

或者使用 HTTPS 克隆你的 github 存储库。

答案2

我遇到了完全一样的问题。

192.30.253.113 是一个 github IP,没有任何问题。

就我的情况而言,我的路由器设置中有“服务过滤器”规则,该规则由于某种原因禁用了端口 22。

您也可以尝试检查您的路由器配置。

答案3

刚刚遇到这个问题 - Gitlab 服务器实际上因计划维护而停机!

即:我的客户端没有任何问题。

相关内容