Git端口22拒绝

错误描述

我在使用 ssh -T git@github.com 时报错:ssh: connect to host github.com port 22: Connection refused

解决办法

  1. ipaddress 输入 github.com 查找到其IP地址

  2. 将查到的IP地址和网址映射放到你的本地 hosts 文件中即可,例子:140.82.112.4 github.com

  3. PS: Windows 下 host 默认地址: C:\Windows\System32\drivers\etc

参考的文章

  1. 大多都是说改成443端口,我试了不行

  2. 这个博客说的能行,谢谢这位大佬的分享