git 警告:永久添加了 IP 地址的 RSA 主机密钥

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18711794/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 16:54:51  来源:igfitidea点击:

Warning: Permanently added the RSA host key for IP address

gitgithubssh

提问by Ashwini

When I do pullfrom Github, I am getting this warning message.

当我pull从 Github执行此操作时,我收到此警告消息。

    MYPC:/Rails$ git pull origin master
    Warning: Permanently added the RSA host key for IP address '#{Some IP address}' to the list of known hosts.
    From github.com:Example/Demo
     * branch            master     -> FETCH_HEAD
    Already up-to-date.

I just want to know which IP address it is adding to the known hosts.

我只想知道它将哪个 IP 地址添加到已知主机。

回答by Rajarshi Das

If you are accessing your repositories over the SSH protocol, you will receive a warning message each time your client connects to a new IP address for github.com. As long as the IP address from the warning is in the range of IP addresses , you shouldn't be concerned. Specifically, the new addresses that are being added this time are in the range from 192.30.252.0 to 192.30.255.255. The warning message looks like this:

Warning: Permanently added the RSA host key for IP address '$IP' to the list of 

如果您通过 SSH 协议访问您的存储库,则每次您的客户端连接到 github.com 的新 IP 地址时,您都会收到一条警告消息。只要警告中的 IP 地址在 IP 地址范围内,您就不必担心。具体来说,这次添加的新地址在从192.30.252.0 to 192.30.255.255. 警告消息如下所示:

Warning: Permanently added the RSA host key for IP address '$IP' to the list of 

https://github.com/blog/1606-ip-address-changes

https://github.com/blog/1606-ip-address-changes

回答by R Yoda

The IP addresses have changed again.

IP 地址再次更改。

github publishes the list of used IP addresses here so you can check the IP address in your message against github's list:

github 在此处发布已使用 IP 地址的列表,以便您可以根据 github 的列表检查消息中的 IP 地址:

https://help.github.com/articles/about-github-s-ip-addresses/

https://help.github.com/articles/about-github-s-ip-addresses/

Or more precisely:

或者更准确地说:

https://api.github.com/meta

https://api.github.com/meta

It looks like this (as I write this answer!):

它看起来像这样(当我写这个答案时!):

verifiable_password_authentication  true
github_services_sha "4159703d573ee6f602e304ed25b5862463a2c73d"
hooks   
0   "192.30.252.0/22"
1   "185.199.108.0/22"
git 
0   "192.30.252.0/22"
1   "185.199.108.0/22"
2   "18.195.85.27/32"
3   "18.194.104.89/32"
4   "35.159.8.160/32"
pages   
0   "192.30.252.153/32"
1   "192.30.252.154/32"
importer    
0   "54.87.5.173"
1   "54.166.52.62"
2   "23.20.92.3"

If you are unsure whether your IP address is contained in the above list use an CIDR calculator like http://www.subnet-calculator.com/cidr.phpto show the valid IP range.

如果您不确定您的 IP 地址是否包含在上面的列表中,请使用 CIDR 计算器(如http://www.subnet-calculator.com/cidr.php)来显示有效的 IP 范围。

E. g. for 140.82.112.0/20the IP range is 140.82.112.0- 140.82.127.255

例如 对于140.82.112.0/20IP 范围是140.82.112.0-140.82.127.255

回答by Kurkula

I had similar problem. In git site after user clicking on clone or download button, while copying the cloned url there are 2 options to select ssh and https. I selected https url to clone and it worked.

我有类似的问题。在用户单击克隆或下载按钮后的 git 站点中,在复制克隆的 url 时,有 2 个选项可以选择 ssh 和 https。我选择了 https url 进行克隆并且它工作正常。

回答by Jamie Bort

From: https://github.blog/changelog/2019-04-09-webhooks-ip-changes/

来自:https: //github.blog/changelog/2019-04-09-webhooks-ip-changes/

April 9, 2019

Webhooks IP changes

The IP addresses we use to send webhooks from are broadening to encompass a larger range.

We are adding IP's within 140.82.112.0/20to the current pool from 192.30.252.0/22.

Learn more about GitHub's IP addresses

2019 年 4 月 9 日

Webhooks IP 更改

我们用来发送 webhook 的 IP 地址正在扩大以涵盖更大的范围。

我们正在将 .IP 中的 IP 添加140.82.112.0/20到当前池中192.30.252.0/22

了解有关 GitHub 的 IP 地址的更多信息

回答by Saurabh Bisht

While cloning you might be using SSH in the dropdown list. Change it to Https and then clone.

克隆时,您可能会在下拉列表中使用 SSH。将其更改为 Https 然后克隆。

回答by Fruit

E.g. ip 192.30.253.112in warning:

例如 ip192.30.253.112警告:

$ git clone [email protected]:EXAMPLE.git
Cloning into 'EXAMPLE'...
Warning: Permanently added the RSA host key for IP address '192.30.253.112' to the list of known hosts.
remote: Enumerating objects: 135, done.
remote: Total 135 (delta 0), reused 0 (delta 0), pack-reused 135
Receiving objects: 100% (135/135), 9.49 MiB | 2.46 MiB/s, done.
Resolving deltas: 100% (40/40), done.

It's the ip if you nslookupgithub url:

如果你的nslookupgithub url是 ip :

$ nslookup github.com
Server:         127.0.0.53
Address:        127.0.0.53#53

Non-authoritative answer:
Name:   github.com
Address: 192.30.253.112
Name:   github.com
Address: 192.30.253.113

$ 

回答by Jum

I solved it by using git push -u origin master

我通过使用解决了它 git push -u origin master