执行git命令的时候提示:
ssh: connect to host ssh.github.com port 443: 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
时提示:
ssh: connect to host ssh.github.com port 22: Connection refused
显示更多日志为:
OpenSSH_for_Windows_9.5p1, LibreSSL 3.8.2
debug1: Reading configuration data C:\\Users\\aft/.ssh/config
debug1: Connecting to ssh.github.com [127.0.0.1] port 22.
debug1: connect to address 127.0.0.1 port 22: Connection refused
ssh: connect to host ssh.github.com port 22: Connection refused
可以看到ssh.github.com的ip地址变成了127.0.0.1
这些都是dns的问题
打开github.com dnsCheck
打开ssh.github.com dnsCheck

把相应的ip配置到hosts文件
20.205.243.166 github.com
20.205.243.160 ssh.github.com
执行ipconfig /flushdns
刷新dns就能连接成功