【发布时间】:2022-11-14 16:22:01
【问题描述】:
基本上我不能再连接到 SSH 服务器了。每当我尝试连接时,我都会收到以下错误:
ssh: connect to host HOSTNAME port 22: Connection refused
请注意,我可以从另一台机器连接。因此,问题似乎是客户端。此外,我也无法拉/推到通过 ssh 克隆的 git 存储库。同样,拉动时出现以下错误:
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 安装/配置文件。我已经重新安装了 SSH,但这并没有解决问题。有任何想法吗?
【问题讨论】:
-
当你运行
ssh git@github.com时,它会返回你的github用户名吗? -
我得到同样的错误:ssh:连接到主机 github.com 端口 22:连接被拒绝
-
如果您在公司环境中,请向您的 IT 部门投诉。否则,请尝试使用 Cloudflare WARP。
-
我在 eduroam 上。通过将 github 主机添加到 ssh 配置文件,我现在可以从 github 中提取。但是我仍然无法通过 SSH 连接到我的私人服务器,即使使用 -p 443 参数也是如此。