1、连接github时报错

连接命令:ssh -T git@github.com

如图:
image.png

  1. kex_exchange_identification: Connection closed by remote host
  2. Connection closed by ::1 port 22

解决方案:
DNS域名解析错误 ,配置本机hosts文件:

  • C:\Windows\System32\drivers\etc
  • 在hosts中添加github的ip地址对应:140.82.112.3 github.com

image.png
再次重复执行连接命令,连接成功:
image.png