GIT fetch remote:SSH 在端口 22 上超时 (Ubuntu)

Pet*_*ete 4 ubuntu ssh virtualbox git

我有一个运行 Ubuntu 9.10 的 Oracle VM VirtualBox,还有一个运行 Ubuntu 9.10 的 pysical DELL 服务器

我可以使用 putty 连接到 VM 和 DELL。我可以通过 ssh 连接到另一个,尽管使用的是 IP 地址。

ssh user@192.168.1.X
Run Code Online (Sandbox Code Playgroud)

然后在两台机器上,我都设置了 git repo:VM 作为 DELL 的克隆 - 我设法成功使用git clone user@192.168.1.X:/path/to/repo/on/DELL

因此,VM 将 DELL 作为远程存储库,称为origin,DELL 将 VM 作为远程存储库,称为siteVM

我在 VM 中做了一些更改,并提交了它们。

但是,如果我尝试从 DELL 存储库中获取数据,则会得到以下信息:

git fetch siteVM
ssh: connect to host 192.169.1.X port 22: Connection timed out
fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)

所以我迷路了。SSH 工作正常,我将 DELL 存储库克隆到 VM 上,没有任何问题。

什么阻止 SSH 通过git fetch工作?

更新:完全是我自己的愚蠢错误。我在git remote add命令中输入了错误的 IP - 我输入了 169 而不是 168。

glg*_*lgl 5

192.168.1.X!= 192.169.1.X.

  • 哈哈,我发现这个问题是因为我犯了那个确切的错误。 (2认同)