Getting permission denied (public key) on gitlab

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

    Another issue that can cause this behaviour is when you have a setup with 2 possible %HOME%-locations.

    I'm using a PC where some of my documents are stored locally, and some of them are stored on a network drive. Some applications think C:\Users\\ is my %home%, others think that U:\ is the home.

    Turns out ssh-keygen put my private key under C:\users\\, and that ssh -T and ssh -v also look there.

    So everything seems to work fine, except that git clone, git push and others look for a key in U:\. Which fails, so I get the aforementioned error.

    It took me an hour to find out, but in the end the solution was simple: I copied everything from C:\Users\\.ssh to U:\.ssh

提交回复
热议问题