Getting permission denied (public key) on gitlab

前端 未结 30 2490
太阳男子
太阳男子 2020-12-02 04:27

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 de

30条回答
  •  一生所求
    2020-12-02 04:45

    Steps to be done, got same error but i fixed it. Gitlab wants ssh-rsa so below is the code to run ssh for rsa

    1. ssh-keygen -o -t rsa -b 4096 -C "name@gmail.com"

    name@gmail.com is your gitlab account email

    1. It will prompt you to enter so just hit Enter after the below code is prompt,

      Enter file in which to save the key (/home/yourDesktopName/.ssh/id_rsa):

    2. It will prompt again you to enter so just hit Enter after the below code is prompt,

      Enter passphrase (empty for no passphrase):

    3. It will prompt again for the last you to enter so just hit Enter after the below code is prompt,

      Enter same passphrase again:

    4. You will show your ssh-rsa generate.

    5. Login to your Gitlab account and Go to the right navbar you will get setting and in the left sidebar you will get ssh key. Enter in it.

    6. Look above the prompt asking you to enter, you will get the path of ssh-rsa.

    7. Go to your SSH folder and get the id_rsa.pub

    8. Open it and get the key and Copy Paste to the Gitlab and you are nearly to done.

    9. Check by: ssh -T git@gitlab.com

    10. You will get: Welcome to GitLab, @joy4!

    11. Done.

提交回复
热议问题