Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Help Wanted Unable to add package: Permission denied (publickey) when using WSL git

Discussion in 'Package Manager' started by Saucyminator, May 20, 2020.

  1. Saucyminator

    Saucyminator

    Joined:
    Nov 23, 2015
    Posts:
    36
    I'm on Windows 10 using WSL, I'm trying to add packages through Git URLs but keep getting errors when doing so.

    Unity version 2019.3
    Windows 10, version 1909
    Git version 2.26.2
    WSL 1

    The ssh-agent is running in the background. I've already gone through the troubleshooting on https://docs.unity3d.com/Manual/upm-errors.html and adding the setx commands

    Code (CSharp):
    1. # Expose env variables to native windows
    2.   setx SSH_AGENT_PID "$SSH_AGENT_PID"
    3.   setx SSH_AUTH_SOCK "$SSH_AUTH_SOCK"
    But I still get these errors when I do:

    Code (CSharp):
    1. Cannot perform upm operation: Unable to add package [ssh://git@gitlab.com/Saucyminator/saucy-test1.git]:
    2.   Error when executing git command. git@gitlab.com: Permission denied (publickey).
    3.   fatal: Could not read from remote repository.
    4.  
    5.   Please make sure you have the correct access rights
    6.   and the repository exists.
    7. [NotFound]
    8. UnityEditor.EditorApplication:Internal_CallUpdateFunctions()
    9.  
    I've got my public key correctly setup on my gitlab account, using bash to clone repos works as expected.

    Bash:
    Code (CSharp):
    1. saucy@Saucy:~$ which git
    2. /usr/bin/git
    3. saucy@Saucy:~$
     
    Last edited: May 20, 2020
  2. Saucyminator

    Saucyminator

    Joined:
    Nov 23, 2015
    Posts:
    36
    After reading the docs I'm going with HTTPS option.

    .

    https://docs.unity3d.com/Manual/upm-git.html
     
unityunity