gpt4 book ai didi

github - SSH 连接到 github 失败

转载 作者:行者123 更新时间:2023-12-03 21:54:46 26 4
gpt4 key购买 nike

我输入命令对 github 进行连接测试:

ssh -T git@github.com

但它输出:
ssh: Could not resolve hostname github.com: nodename nor servname provided, or not known

为什么 ssh 无法解析 github.com?我想知道这个以及如何解决它?

最佳答案

检查您的网络或 dns 配置(如 this question )。
git and ssh: Could not resolve hostname, ping works ”提到:

This sounds like a DNS issue. Try switching to another DNS server and see if it works.


OpenDNS

208.67.222.222
208.67.220.220

GoogleDNS

8.8.8.8
8.8.4.4

如果 ssh 仍然给您带来困难,请尝试切换到 https。

OP Edlin确认 in the comments切换 DNS 有效,并向 Mac OS X 用户推荐 How-to Geek文章“ How to Switch Mac OS X to Use OpenDNS or Google DNS ”:

  • System Preferences…
  • click on the Network icon…
  • select your network card on the left and then select the Advanced button near the bottom right corner.
  • switch over to the DNS tab, and you can start adding in DNS entries into the list.
    Click the + symbol at the bottom to add new ones:


http://www.howtogeek.com/geekers/up/sshot4d0b1298a026e.jpg

关于github - SSH 连接到 github 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21488137/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com