Getting permission denied (public key) on gitlab

前端 未结 30 2540
太阳男子
太阳男子 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:36

    Earlier it was very difficult for me but when I tried it became so easy to add ssh key in Mac and Linux. There are a few steps and command to do this as follows:

    1. Open a terminal of your system and move inside your project directory by the command:
    cd 'project directory name'
    
    1. Run command ssh-keygen in that terminal and enter it until the key's randomart image appears there.

    2. Then enter one more command in that terminal:

    cat ~/.ssh/id_rsa.pub
    

    It will generate your ssh key. Key will start with ssh-rsa and end with .local.

    1. Copy the key and go to your Gitlab profile section then ssh key section and paste it there. Click on the Add button this will work.

提交回复
热议问题