gitlab连接拒绝了ssh端口22和443

时间:2018-04-07 18:17:21

标签: git ssh connection gitlab

在过去的几天里,我一直无法推送到遥控器(gitlab),它在此之前已经工作了。我知道这个问题有10个类似的SO问题,也许答案就在那些问题中。但是我一直在尝试许多建议的解决方案 - 徒劳无功。

  • 当我推动时,我得到:

    ssh: connect to host gitlab.com port 22: Connection refused fatal: The remote end hung up unexpectedly

  • 本地人在宪法服务器上,很多人在这里使用端口22主要用于github而没有任何问题。这可能是我身边的防火墙设置,可能与gitlab有关吗?管理员确保它不是简单的白名单问题。

  • 我的gitlab网址如下:

    origin git@gitlab.com:myname/myproject.git (fetch) origin git@gitlab.com:myname/myproject.git (push)

  • 我尝试使用备用ssh格式更新git-url:

    origin ssh://git@gitlab.com/myname/myproject.git (fetch) origin ssh://git@gitlab.com/myname/myproject.git (push)

  • 我尝试了端口22和替代443 - 这是~/.ssh/config文件:

    Host gitlab.com RSAAuthentication yes IdentityFile ~/.ssh/id_rsa

  • 替代方案:

    Host gitlab.com Hostname altssh.gitlab.com User git Port 443 PreferredAuthentications publickey IdentityFile ~/.ssh/id_rsa

  • 我尝试过使用https连接(徒劳)。

  • 制作新的ssh密钥(徒劳)。

我迷失了尝试的东西,我的分支在许多提交中领先于原点。 我错过了一些简单的尝试吗?。

更新

当删除〜/ .ssh / config并发出ssh -Tv git@gitlab.com时,它仍然不起作用 - 我得到:

OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to gitlab.com [52.167.219.168] port 22.
debug1: connect to address 52.167.219.168 port 22: Connection refused
ssh: connect to host gitlab.com port 22: Connection refused

更新2 事实证明,我们的机构服务器并没有将gitlab.com列入白名单,因为它们与github.com相比,并没有提供正式的IP地址范围。我的解决方案是从我的工作站计算机到包含我的项目的服务器的挂载点,然后通过计算机推/拉git目录。

1 个答案:

答案 0 :(得分:1)

确保您的案例中有 firebase.storage文件:您提及的默认网址应该在没有<i class="fa fa-bars toggle_menu"></i> <div class="sidebar"> <i class="fa fa-times"></i> <center><br><img src="http://cpi.caribbeanprocurementinstitute.com/wp-content/uploads/2018/04/logo-2.png"> </center> <ul> <li><a href="" style="color:#FFF;">Home</a></li> <li><a href="" style="color:#FFF;">Who We Are</a></li> <li><a href="" style="color:#FFF;">What We Do</a></li> <li><a href="" style="color:#FFF;">Blog</a></li> <li><a href="" style="color:#FFF;">Contact Us</a></li> </ul> </div> <script type="text/jscript"> $("fa-times").click(function(){ $("toggle_menu").hide(); }); $("fa-bars").click(function(){ $("sidebar").show(); }); </script> <script src="https://code.jquery.com/jquery-3.2.1.js"> </script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> 文件的情况下工作。

并确保~/.ssh/config的内容已注册到您的帐户。

测试是这样的:

config

如果这不起作用,则表示ssh端口被阻止,或者ISP无法访问远程站点。

事实证明,OP提到了第二种情况:

  

我们的机构服务器没有将gitlab.com列入白名单,因为它们与github.com相比,不提供正式的IP地址范围。
  我的解决方案是从我的工作站计算机到包含我的项目的服务器的挂载点,然后通过计算机推/拉git目录。

相关问题