gpt4 book ai didi

ssh - gitlab.com SSH连接超时

转载 作者:行者123 更新时间:2023-12-02 13:46:05 26 4
gpt4 key购买 nike

我尝试通过SSH使Gitlab正常运行,但事实并非如此。

我已经完成以下步骤:

1)生成ssh-key

ssh-keygen -t rsa -C "myemail@myhoster.com" -b 4096

2)在文件夹/Users/myUserName/.ssh/中将 key “id_rsa”命名为

3)通过复制 key
pbcopy < ~/.ssh/id_rsa.pub

4)将 key 插入gitlab

当我现在尝试克隆存储库时,出现以下错误:
$ git clone git@gitlab.com:myName/repositoryName/ repoName
Cloning into 'repoName'...
ssh: connect to host gitlab.com port 22: Operation timed out
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

怎么了?

最佳答案

我发现自己也遇到了同样的问题。
正如 Adrian Dymorz 所述,您可以使用以下命令检查是否可以通过SSH访问Gitlab:

ssh git@gitlab.com
您应该收到这样的响应:
...
Welcome to GitLab, <Gitlab ID Account>!
Shared connection to altssh.gitlab.com closed.
如果不是,那么 betarrabara 应该可以解决您的问题 但是您不应该提供 id_rsa ,而应该提供 id_rsa.pub :
Host gitlab.com
Hostname altssh.gitlab.com
User git
Port 443
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa.pub

关于ssh - gitlab.com SSH连接超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51079198/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com