在gitlab上获取权限(公钥) [英] Getting permission denied (public key) on gitlab
问题描述
我的问题是我无法从GitLab推送或获取。但是,我可以克隆(通过HTTP或通过SSH)。我尝试推送时出现此错误:
权限被拒绝(publickey)致命:无法从远程存储库读取
在我看过的所有主题中,这里是我所做的:
>
现在我想打我的电脑。如果您有任何关于如何解决我的问题的见解,我们将不胜感激。
我在搜索很多后发现此问题。它对我来说工作得很好。
- 像cmd一样转到Git Bash。右键单击并以以管理员身份运行。
- 输入
ssh-keygen
- 按回车。
- 它会要求您将密钥保存到特定目录。
- 按下回车键。它会提示你输入密码或输入密码。
- 公钥将被创建到特定目录。
- 现在转到目录并打开
.ssh
文件夹。 - 您将看到一个文件
id_rsa.pub
。在记事本上打开它。复制所有文本。 - 转到 https://gitlab.com/个人资料/密钥。
- 现在点击下面的标题。然后点击添加密钥。
现在给它一枪,它会肯定工作。
My problem is that I can't push or fetch from GitLab. However, I can clone (via HTTP or via SSH). I get this error when I try to push :
Permission denied (publickey) fatal : Could not read from remote repository
From all the threads I've looked, here is what I have done :
- Set up an SSH key on my computer and added the public key to GitLab
- Done the config --global for username and email
- Cloned via SSH and via HTTP to check if it would resolve the issue
- Done the ssh -T git@gitlab.com command
Right now I want to punch my computer. If you have any insight about how to resolve my issue, it would be greatly appreciated.
I found this after searching alot. It will work perfectly fine for me.
- Go to "Git Bash" just like cmd. Right click and "Run as Administrator".
- Type
ssh-keygen
- Press enter.
- It will ask you to save the key to the specific directory.
- Press enter. It will prompt you to type password or enter without password.
- The public key will be created to the specific directory.
- Now go to the directory and open
.ssh
folder. - You'll see a file
id_rsa.pub
. Open it on notepad. Copy all text from it. - Go to https://gitlab.com/profile/keys .
- Paste here in the "key" textfield.
- Now click on the "Title" below. It will automatically get filled.
- Then click "Add key".
Now give it a shot and it will work for sure.
这篇关于在gitlab上获取权限(公钥)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!