Reputation: 2896
I’m running Apache Netbeans 12 on Windows and I’m really struggling to connect to my github repositories using an SSH connection. I get the strong impression that this has been a problem for Netbeans users for a long time. What I’ve tried so far:
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.
This is the kind of response (about Netbeans 7 remember, I'm still struggling with version 12) which I find frustrating:
“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.”
Not it’s not. I simply can’t get Netbeans to clone a github repository following the standard wizard documentation.
John Gibson commented on GitLab CE issue #624 (https://gitlab.com/gitlab-org/gitlab-ce/issues/624#note_299061) that he encountered a similar error. He explains that he "discovered that all of the available ciphers on the server were at least 256 bits. Standard Oracle Java ships with crypto that's restricted to 128 bits for some algorithms. After installing the unlimited strength crypto package from Oracle the issue went away. Note that the unlimited strength package is only legally available in the US. If you're outside of the US then I think that OpenJDK will work instead."
I followed the link he mentioned (http://www.oracle.com/technetwork/java/javase/downloads/jce-7-download-432124.html), downloaded the Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files 7 and followed the steps in the readme-file that came with the download.
“Current versions of the JDK do not require separate unlimited policy files. They are provided for use with older versions. The unlimited policy files for earlier releases are required only for JDK 7 updates earlier than 7u171.”
So, that doesn’t work either. I am absolutely stumped. What do I have to do to get the latest, shiniest version of Netbeans to work smoothly with github and SSH connections?
Upvotes: 5
Views: 1800
Reputation: 20253
I'm using macOS and was able to fix this, but the order of things is a bit tricky.
First go to the SSH folder and delete the known hosts (or remove the GitHub section from it):
cd ~/.ssh
rm known_hosts
Then change the key format as explained in "Invalid privatekey" when using JSch :
cp yourkeyfile yourkeyfile.bak
ssh-keygen -p -f yourkeyfile -m pem
Then verify it is working (enter yes
when asked to continue, which creates the known hosts file again):
ssh -T [email protected]
Close NetBeans if it is still running and start it again.
In the clone dialog leave the key and passphrase fields blank.
Upvotes: 3
Reputation: 11
I had the same problem and after a long search I found how to solve it. It is about the way private keys are generated.
Check this.
Upvotes: 1
Reputation: 7077
I had a similar problem, I believe, but on MacOS. For me the solution was to change the permissions on the id_rsa
file, as suggested here, to 400
, which means read-only access for the owner and no access at all for anyone else. Not sure how to set the equivalent permissions on Windows, but it might help you.
Upvotes: 0
Reputation: 1
I'm not sure if this helps, but I also had problems to clone a repository with the NetBeans wizard, but they disappeared on the next day, probably because of rebooting Windows or restarting NetBeans. It also seems that NetBeans does not support any abbreviations you might have defined in the .ssh/config. So you got to use the long form "[email protected]/..." here. That might explain why the git clone command did work from the command line, but not in the wizard.
Upvotes: 0
Reputation: 1329072
Try without Cygwin at all.
Launch Netbeans in a simplified path which includes only:
That is:
set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\
set GH=C:\path\to\git
set PATH=%GH%\bin;%GH%\usr\bin;%GH%\mingw64\bin;%PATH%
set PATH=C:\path\to\java\bin;%PATH%
Git for Windows itself includes everything you need for OpenSSH to work.
Upvotes: 0