3

I have access to a specific (internal) gitlab repo which I can clone, (having configured my ssh key on the server):

git clone git@mygitlabserver:mynamespace/myproject.git

However, when trying to directly install via pip a specific artifact from a tag:

pip install git+ssh://mygitlabserver:mynamespace/myproject.git@v0.2.0#egg=myartifact

I get a password prompt.

I have also tried the following:

pip install git+ssh://atemporaryTOKENofmine@mygitlabserver:mynamespace/myproject.git@v0.2.0#egg=myartifact

pip install git+ssh://oauth2:atemporaryTOKENofmine@mygitlabserver:mynamespace/myproject.git@v0.2.0#egg=myartifact

pip install git+ssh://gitlab-ci-token:atemporaryTOKENofmine@mygitlabserver:mynamespace/myproject.git@v0.2.0#egg=myartifact

Any suggestions?

edit: the proposed duplicate does not resolve my issue cause it is not the case of a passphrase-protected key, but rather than a wrong url used.

Thanks to @nils-werner for resolving it (check accepted answer)

pkaramol
  • 16,451
  • 43
  • 149
  • 324
  • Possible duplicate of [SSH Key - Still asking for password and passphrase](https://stackoverflow.com/questions/21095054/ssh-key-still-asking-for-password-and-passphrase) – Laur Ivan Oct 16 '17 at 10:15

1 Answers1

5

You're mixing two kinds of URLs:

git@mygitlabserver:mynamespace/myproject.git

Is equivalent to

ssh://git@mygitlabserver/mynamespace/myproject.git

whereas you tried (note the missing username and incorrectly used colon)

ssh://mygitlabserver:mynamespace/myproject.git

This means the correct pip command is

pip install git+ssh://git@mygitlabserver/mynamespace/myproject.git@v0.2.0#egg=myartifact
Nils Werner
  • 34,832
  • 7
  • 76
  • 98