Dev builds, but true as long as I can remember. I am unable to use NetBeans to perform any Git operations requiring SSH authentication: pushing to GitHub, pulling from a private repository, etc. The same operations using command-line Git work fine, but in NetBeans I am prompted for a username and password, or for a private key with passphrase. This is unnecessary from the command line as I use ssh-agent to unlock my private key without needing to type in the passphrase every time; apparently the Git library used by NB does not manage to communicate with ssh-agent so it fails.
Note that ssh-agent is run by default on a modern Linux distribution, and probably on Macs as well. I do not wish to have SSH credentials stored in any other way.
https://sourceforge.net/tracker/index.php?func=detail&aid=3555106&group_id=273755&atid=1163478 may be relevant.
If it is not feasible to fix the in-JVM library to work properly with ssh-agent, at least offer the option to use command-line Git for remote operations so I do not need to use a shell just to ‘git pull’ or ‘git push’.
Git uses JGit (a pure Java implementation of Git client) which does not use either commandline client or an external ssh process to run remote commands. It uses jsch as ssh implementation. Do you have any idea if JSch can be somehow made to cooperate with ssh-agent?
BTW, what's the problem with keeping your passwords in keyring? You are its original author so i would assume you'd believe in its reliability.
> at least offer the option to use command-line Git for remote operations
Sorry, i have no intention of letting the commandline client into the game, the whole point of using JGit was to avoid parsing commandline output, running external processes and forcing user to setup the ssh-agent when you can simply enter all needed data inside the IDE only.
this might be the way: bug #206698
jsch-agent-proxy sounds like the right solution; I did not find this before. Marking as a dependency on bug #206698 since that is categorized under CVS, though the same fix would probably apply to both.
(In reply to comment #1)
> forcing user to setup the ssh-agent
Modern Linux distributions, and IIRC Macs as well, set it up out of the box.
I found that you can use the private keyring option as a workaround. But it is awkward: for every repository you connect to, you need to browse to ~/.ssh/id_[dr]sa (why is this not the default?), and reënter your passphrase.
at least some evaluation needed in 7.3next
Should be relatively transparent for the user. When selecting identity file/passphrase authentication the git library should first ask sshagent and only when that fails use the actual identity files/passphrase authentication.
Integrated into 'main-golden', will be available in build *201305032300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Ondrej Vrabec <firstname.lastname@example.org>
Log: #218918 - Cannot push from NetBeans using ssh-agent
support for ssh-agent and pageant
It works, thanks.
A UI comment, though: rather than popping open a dialog defaulting to password authentication and making the user (a) click the radio button for private key authentication, (b) clicking the Browse button and selecting ~/.ssh/id_[rd]sa, why not just try authenticating with ssh-agent right away and only bother the user if this does not work?
Seems that the automatic use of ssh-agent is now working; maybe was only broken for repositories which I had tried to push/pull from in NetBeans prior to this fix.