sztu@sztu:/data2/webServer/SZTUEnroll_student$ git pull
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.

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

在这里插入图片描述

二、解决方案

使用 SSH 443 端口(绕过防火墙)

1.查询链接情况以及详情

ssh -Tv git@github.com

sztu@sztu:/data2$ ssh -Tv git@github.com
OpenSSH_9.8p1, OpenSSL 3.0.13 30 Jan 2024
debug1: Reading configuration data /usr/local/etc/ssh_config
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug1: Connecting to github.com [20.205.243.166] port 22.
在这里插入图片描述
使用SSH 443 端口

2.编辑 /usr/local/etc/ssh_config

在底部添加

Host github.com
  Hostname ssh.github.com
  Port 443
  User git

在这里插入图片描述

3.确定是否修改成功

ssh -Tv git@github.com

在这里插入图片描述
出现下面这些就调整完成

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐