-
-
Notifications
You must be signed in to change notification settings - Fork 270
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pkg add private repo not using ssh key #1733
Comments
I think maybe libgit2 just doesn't honor these? |
Maybe --- I do think that this is an important feature to support for non-open-source users to use julia --- Maybe an issue has to be opened for libgit2? Or is it not being passed correctly to libgit2? |
See https://discourse.julialang.org/t/how-to-specify-the-ssh-key-for-pkg-to-use/14784/6 and #1516 (comment). The problem is probably not the location of the private key, but some other SSH problem during authentication. |
There are plenty of situations in which the regular SSH client works just fine, but libssh (which is what libgit2 uses) does not work. As long as Julia and Pkg rely on libgit2, these issues will keep cropping up. |
I see that What does this mean? |
I think another issue is the |
libgit2 has released their 1.0 whilst julia uses 0.28.2 ---> maybe an update will help. |
For libssh2, I am confused about which version is being used:
|
I stumbled onto this again. As @imikim pointed out, even public repos fail in this way, and the workaround is to switch to an
edit: can someone change the name so that it doesn't mention private repos? It led me not to look here at first. Something like "Pkg add/dev [email protected]:... fails with private key prompts" |
Another possible solution :
I hope it may help someone else. :) The error I had initially :
|
@EliseBcm, thanks for that! I for one did not have any idea that the absence of github.com from the known hosts file was the issue, so adding instructions for that would be good. However, servers with different IP addresses are distinguished by SSH, so it's possible that fixing that once will not be enough — if you end up connecting to a github.com SSH server with a different IP address, you'll have to do it again. Unlike HTTPS, where there's a public key infrastructure — broken and confusing as it is; almost no one currently supports certificate revocation, for example — which means that clients know in advance whether they should trust an HTTPS server or not. SSH relies on you approving the server the first time and then verifying that identity in the future. One option would be that we could (if possible) configure libgit2 to auto-trust unknown servers the first time one connects to them, but that's pretty iffy as a default policy. If an attacker wants to man-in-the-middle your connection, all they have to do is arrange for your github.com DNS query to return an IP address that they control. Since DNS is often not secured, this is a pretty huge security risk. If we can force DNS-over-HTTPS to a known secure host, that might be acceptable. Of course that will not work for private domains, so it's not a perfect solution either. I'm not sure if there is a perfect solution for this. At the very least, it would be good to detect this specific failure mode and print a better error message. |
@EliseBcm Your solution unfortunately did not work for me on [email protected] |
I've got problems with adding/cloning git repos using
|
A work around I used for avoiding this behaviour was to eval the ssh-agent inside of the julia terminal. You can open a shell with
|
These issues may be addressed on master with the new NetworkOptions library that is part of Julia 1.6. |
I had this issue but was able to get it to work with ssh-agent:
I don't think it matters but I also have Also on 1.6-beta1 I had to add
I'm on Manjaro Linux. Hopefully that helps some others. |
The original issue here seems to be solved — I'm able to git clone via libgit2 using both encrypted and unencrypted SSH keys. The rest of the issues in this thread seem to be some combination of incorrect ssh-agent setups and needing to adjust the syntax for adding from a specific branch. |
A colleague had this issue (from the OP) and managed to fix it by converting the private key to PEM format with
cf #911 (comment) (posting for future me and for any other that might find this issue when searching). |
The text was updated successfully, but these errors were encountered: