git - 在 GitHub 上推送到远程指向一个新的服务器 IP

标签 git github ssh

我不知道发生了什么变化,但当我尝试在 GitHub 上推送到我的远程服务器时,它转到了一个完全未知的 IP,这让我大吃一惊。

[slavik@localhost guardonce]$ git push origin master
Warning: Permanently added the RSA host key for IP address '192.30.252.128' to the list of known hosts.
Connection closed by 192.30.252.128
fatal: Could not read from remote repository.
Please make sure you have the correct access rights and the repository exists.

其他测试表明我本地机器的配置没有问题。例如:

[slavik@localhost guardonce]$ ssh -T git@github.com
Hi slavik81! You've successfully authenticated, but GitHub does not provide shell access.

[slavik@localhost guardonce]$ git remote -v
origin  git@github.com:slavik81/guardonce.git (fetch)
origin  git@github.com:slavik81/guardonce.git (push)

查看我的已知主机,我预计会与 github.com,204.232.175.90 通话。那么,我为什么不呢?

最佳答案

现在(2013 年 8 月 25 日)发生的变化在“IP Address Changes”中解释:

We mentioned these new addresses back in April and updated the Meta API to reflect them.
Some GitHub services have have already been migrated to the new addresses, including:

api.github.com
gist.github.com
ssh.github.com

Our next step is to begin using these IP addresses for the main GitHub site, so we're reminding everyone about this change.
There are a few gotchas that might affect some people:

  • If you have explicit firewall rules in place that allow access to GitHub from your network, you'll want to make sure that all of the IP ranges listed in this article are included.

  • If you have an entry in your /etc/hosts file that points github.com at a specific IP address, you should remove it and instead rely on DNS to give you the most accurate set of addresses.

  • 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 in the previously mentioned Help page, 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 known hosts.

关于git - 在 GitHub 上推送到远程指向一个新的服务器 IP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18265851/

相关文章:

eclipse - git gc/git gui : Unlink of file <internal pack file name> failed

Android:使用相机源代码时遇到问题

java - 使用 Git 开发包含多个 Eclipse 项目的应用程序?

github - 是否可以同时满足 Github 和 Doxygen 的方式编写 Markdown 链接?

git - 在保留问题、wiki 等的同时替换 GitHub 存储库

ssh - 如何通过 ssh 调用 AAC 音频流功能

git - 在使用 Git 或 SSH 复制/远程登录等时,我们应该重复使用相同的 SSH key 还是每次都创建新 key ?

git - GitHub 上实际显示的 merge 提交的差异是什么?

linux - Putty 作为 cmd 和 sh 之间的接口(interface)

ssh - paramiko.ssh_exception.SSHException:TCP转发请求被拒绝