【问题标题】:How do you find your GitLab host name (to test your SSH key)?你如何找到你的 GitLab 主机名(以测试你的 SSH 密钥)?
【发布时间】:2017-09-05 06:09:47
【问题描述】:

我刚刚创建了一个个人 GitLab 帐户并尝试按照上的步骤进行操作

https://gitlab.com/help/ssh/README

将我的 SSH 密钥部署到 GitLab。我已完成第 5 步,并在我的用户设置 -> SSH 密钥中的“您的 SSH 密钥”中查看我的 SSH 密钥:

我现在正在尝试完成可选的第 6 步,测试密钥:

我的 GitLab 用户名是 khpeek,所以我猜我的“GitLab 域”是 gitlab.com/khpeek。但是,测试命令

ssh -T git@gitlab.com/khpeek

产生错误消息:

ssh: Could not resolve hostname gitlab.com/khpeek: Name or service not known

显然这是错误的主机名。什么是正确的?

【问题讨论】:

    标签: ssh gitlab


    【解决方案1】:

    如果你在 gitlab.com 上使用 Gitlab,那么域名就是 gitlab.com,所以你应该运行 ssh -T git@gitlab.com

    【讨论】:

    • 如果您使用代理并且需要配置 vim ~/.ssh/config,请注意主机名:Host gitlab.com HostName altssh.gitlab.com
    猜你喜欢
    • 2015-10-06
    • 2010-10-07
    • 2010-09-25
    • 1970-01-01
    • 2020-03-03
    • 2019-10-10
    • 2010-09-23
    • 2010-09-29
    • 2010-10-05
    相关资源
    最近更新 更多