我尝试让 Gitlab 与 SSH 一起工作,但不行。
我已完成以下步骤:
1)生成ssh密钥
ssh-keygen -t rsa -C "[email protected] /cdn-cgi/l/email-protection" -b 4096
2 ) 在文件夹 /Users/myUserName/.ssh/ 中将密钥命名为“id_rsa”
3)通过复制密钥
pbcopy < ~/.ssh/id_rsa.pub
4)将密钥插入gitlab
当我现在尝试克隆存储库时,我收到以下错误:
$ git clone [email protected] /cdn-cgi/l/email-protection: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.
出了什么问题?
我发现自己也遇到了同样的问题。
As 阿德里安·迪莫兹描述你可以使用以下命令检查是否可以通过 SSH 访问 Gitlab:
ssh [email protected] /cdn-cgi/l/email-protection
您应该收到如下回复:
...
Welcome to GitLab, <Gitlab ID Account>!
Shared connection to altssh.gitlab.com closed.
如果没有,那么贝塔拉巴拉应该可以解决你的问题BUT你不应该提供你的id_rsa但你的id_rsa.pub反而:
Host gitlab.com
Hostname altssh.gitlab.com
User git
Port 443
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa.pub
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)