connect to host github.com port 22: Connection timed out

79 views
Skip to first unread message

Wei Hu

unread,
Jan 24, 2024, 12:42:21 AMJan 24
to git-for-windows
I cannot connect  to github.com on my GFW .
I just haven't used it for a period,If i use it again,it while frequently show the log "connection timeout"
```
PS C:\Users\PreX\Desktop> git clone g...@github.com:PreX-AW/Obsidian.git
Cloning into 'Obsidian'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
```
And I try the command `ssh -vT g...@github.com`
```
PS C:\Users\PreX\Desktop> ssh -vT g...@github.com
OpenSSH_for_Windows_8.6p1, LibreSSL 3.4.3
debug1: Reading configuration data C:\\Users\\PreX/.ssh/config
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug1: Connecting to github.com [20.205.243.166] port 22.
debug1: connect to address 20.205.243.166 port 22: Connection timed out
ssh: connect to host github.com port 22: Connection timed out
```

Konstantin Khomoutov

unread,
Jan 24, 2024, 2:50:25 AMJan 24
to git-for...@googlegroups.com
I'm afraid it's not a GfW issue: the IP-address 20.205.243.166 does indeed
belong to Microsoft, and it works for me: I'm able to connect to port 22
on it just fine (and see an SSH greeting).

What's a bit weird is that for me, github.com resolves to a different address:

~$ host -t a github.com
github.com has address 140.82.121.4

which *might* suggest you have some sort of override installed for this
address in your local settings - like an entry in
%system32%\drivers\etc\hosts - but it also might just be some artefact of
DNS setup for github (though I get the same result if I resolve github.com
via the Google's public DNS server, 8.8.4.4).

All-in-all, that "Connection timed out" is a purely networking issue: your
local SSH client has tried to establish a TCP connection to 20.205.243.166:22,
and the protocol's three-way handshake failed to complete in time.

Wei Hu

unread,
Jan 25, 2024, 7:17:01 AMJan 25
to git-for-windows
Thanks for your reply. But I don't know how to solve this problem, please forgive me as a beginner.
Shall I change my local setting about IP? Or how can I establish the connection to GitHub by changing my address? 
Reply all
Reply to author
Forward
0 new messages