My github suddenly failed to connect
$ git push
ssh: connect to host github.com port 22: Connection refused
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
尝试过
$ ssh -T -p 443 git@ssh.github.com
Hi alinbxSorcerer! You've successfully authenticated, but GitHub does not provide shell access.
有什么问题,多年来一直运行良好。
最佳答案
也许您所在的网络阻塞了端口 22。
设置 ssh 从现在起始终为 Github 使用端口 443:
将以下内容添加到您的 .ssh/config
文件中:
Host github.com
Hostname ssh.github.com
Port 443
另一个选项是切换到使用 https
存储库 url,但我觉得时不时地输入密码很烦人。
更多信息:https://help.github.com/en/github/authenticating-to-github/using-ssh-over-the-https-port
关于Github突然连接不上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59172528/