【问题标题】:ssh through port 443 on gitlab not working通过 gitlab 上的端口 443 SSH 无法正常工作
【发布时间】:2017-06-25 15:49:43
【问题描述】:

我正在尝试使用端口 443 来推送和拉取我的 gitlab 存储库,因为我的端口 22 已被阻止(参考:https://about.gitlab.com/2016/02/18/gitlab-dot-com-now-supports-an-alternate-git-plus-ssh-port/

我在下面给出了我创建的配置文件(我创建了一个新的 ssh 密钥,并在我的 gitlab 配置文件中进行了更新 - 注意:我没有将服务器密钥添加为部署密钥,而是将它添加到我的个人资料)

我的配置文件:

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

我不断收到以下错误:

权限被拒绝(公钥) 致命:无法从远程存储库读取

错误可能是由于 ssh 密钥以外的其他原因造成的吗?

问候, 加利杰

【问题讨论】:

  • 你有解决办法吗?我有同样的问题
  • 没有。我们目前使用 https 而不是 ssh。我们还没有弄清楚:(
  • 我发现 ssh 可以通过电缆而不是 wifi 为我工作
  • 我们都试过了。没有帮助。

标签: gitlab


【解决方案1】:

我刚刚配置了它,它对我来说效果很好。

在您的配置文件中,您需要使用私钥id_rsa 进行身份验证,而不是使用公钥id_rsa.pub

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

您可以使用此命令ssh -T -p 443 git@altssh.gitlab.com 测试连接。

确保您已将公钥 id_rsa.pub 添加到您的 GitLab 帐户中,为 described here

【讨论】:

  • 感谢您的回答!!
猜你喜欢
  • 2011-12-03
  • 2019-02-19
  • 1970-01-01
  • 1970-01-01
  • 2018-09-17
  • 1970-01-01
  • 2021-11-21
  • 1970-01-01
  • 2011-03-07
相关资源
最近更新 更多