ssh - 您如何找到您的 GitLab 主机名(以测试您的 SSH key )?

标签 ssh gitlab

我刚刚创建了一个个人 GitLab 帐户,正在尝试按照以下步骤操作

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

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

enter image description here

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

enter image description here

我的 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

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

最佳答案

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

关于ssh - 您如何找到您的 GitLab 主机名(以测试您的 SSH key )?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43319094/

相关文章:

git - 使用 git (dokku) 部署时出错 - 超时/管道损坏

ssh - 当我尝试在 `ddev auth ssh` 之后在 DDEV web 容器中使用 ssh 时,ssh key 似乎不起作用, "too many authentication failures"

mysql - 通过 SSH 使用 R (RMySQL) 连接 MySQL

GitLab:缺少从问题创建分支的选项

git - 无法通过SSH访问远程存储库(权限被拒绝(公钥))

python - Python 中的 SSH 动态端口转发 ('ssh -D')

git - Jenkins,通过 ssh 与多个用户获取 git 子模块?

gitlab - `test:first job: script should be a string or an array of a strings`

bash - 带有 Okta 的 Gitlab 访问 token

git - 从 Gitlab 镜像到 Github