I can't seem to pip install a private repository from github, and I'm pretty sure I've traced the problem to the key file. The complicating factor is that I have dozens of keyfiles in my ~/.ssh directory, and it doesn't seem to work when I try to specify a specific keyfile. For pip install, it's choosing the first keyfile regardless of my syntax.
Installing repo1 works, including when no such key file exists or if the wrong keyfile is specified:
> pip install git+ssh://[email protected]/username/repo1.git
> pip install --cert ~/.ssh/keyfile1 git+ssh://[email protected]/username/repo1.git
> pip install --cert ~/.ssh/keyfile1_BLAH_NO_SUCH_FILE git+ssh://[email protected]/username/repo1.git
> pip install --client-cert ~/.ssh/keyfile1 git+ssh://[email protected]/username/repo1.git
> pip install --client-cert ~/.ssh/keyfile1_BLAH_NO_SUCH_FILE git+ssh://[email protected]/username/repo1.git
> pip install --client-cert ~/.ssh/keyfile2 git+ssh://[email protected]/username/repo1.git
Installing repo2 doesn't work, regardless of syntax:
> pip install git+ssh://[email protected]/username/repo2.git
> pip install --cert ~/.ssh/keyfile2 git+ssh://[email protected]/username/repo2.git
> pip install --client-cert ~/.ssh/keyfile2 git+ssh://[email protected]/username/repo2.git
I can verify the key files are correct and recognized by Github by doing this:
> ssh -T [email protected]
Hi username/repo1! You've successfully authenticated, but GitHub does not provide shell access.
> ssh -T [email protected] -i ~/.ssh/keyfile1
Hi username/repo1! You've successfully authenticated, but GitHub does not provide shell access.
> ssh -T [email protected] -i ~/.ssh/keyfile2
Hi username/repo2! You've successfully authenticated, but GitHub does not provide shell access.
I can verify that keyfile1 is used if a key file is not specified or specified incorrectly:
> ssh -T [email protected] -i ~/.ssh/keyfile1_BLAH_NO_SUCH_FILE
Warning: Identity file keyfile1_BLAH_NO_SUCH_FILE not accessible: No such file or directory.
Hi username/repo1! You've successfully authenticated, but GitHub does not provide shell access.
> ssh -T [email protected]
Hi username/repo1! You've successfully authenticated, but GitHub does not provide shell access.
So I think this tells me keyfile2 is good.
And to eliminate the possibility of there being a problem with repo2, I moved the keyfile1 over to repo2 in github and repo2 was then the only repository that I could pip install.
So, it appears as though my pip install syntax only works for the first keyfile because it find it first, and I'm either incorrectly specifying the keyfile or my specification is being ignored.
pip 20.2.4
Any ideas?