美文网首页
github 22端口连接超时

github 22端口连接超时

作者: 王某某的笔记 | 来源:发表于2024-07-22 17:14 被阅读0次

现象

>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.

但是443端口可以

>ssh -T -p 443 git@ssh.github.com
The authenticity of host '[ssh.github.com]:443 ([20.205.243.160]:443)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '[ssh.github.com]:443' (ED25519) to the list of known hosts.
Hi wangwen135! You've successfully authenticated, but GitHub does not provide shell access.

在用户目录新增config文件

$ vim ~/.ssh/config

内容如下:

# Add section below to it
Host github.com
  Hostname ssh.github.com
  Port 443

再测试一下:

$ ssh -T git@github.com
Hi xxxxx! You've successfully authenticated, but GitHub does not
provide shell access.

相关文章

网友评论

      本文标题:github 22端口连接超时

      本文链接:https://www.haomeiwen.com/subject/hqxyhjtx.html