EGit not remembering SSH passphrase - eclipse

Using the terminal git command and RabbitVCS, I am never asked for my SSH passphrase, since it is added to the SSH agent:
me#mymachine:~$ ssh-add -l
2048 s0:m3:f1:ng:3r:pr:1n:7... me#domain.tld (RSA)
Anyway, I have issues using EGit with Eclipse. I am prompted for my passphrase when I make an action that requires remote access.
After looking for solutions, I found this SO question: How to make eclipse remember ssh key passphrase?
Basically I have the same issue. So I tried to set the environment variable, restarted my machine but it just won't work...
me#mymachine:~$ echo $GIT_SSH
/usr/bin/ssh
(The environment variable is set in .bash-aliases like suggested in the other question)
Since this approach has not worked for me, I was looking for other possible issues which could prevent EGit from using the SSH key from the SSH agent, but in every question/topic/thread setting the environment variable fixed the problem for the people who had the same issue...
What can I do to make this running?
What else could lead to this behaviour?
What can I do to debug this?
Some more information:
Eclipse: Version: Luna Service Release 2 (4.4.2)
EGit: 4.0.1.201506240215-r (up-to-date)
Ubuntu: 15.04
The key was generated using ssh-keygen, and I dont want to use another key or create a new one

I found out that Eclipse was not aware of the GIT_SSH environment variable. When I ran Eclipse through the terminal, everything was fine. After I relaunched Eclipse from the Unity side panel, it refused to work again. My fix was to make a custom eclipse.desktop file in ~/.local/share/applications with the following content:
[Desktop Entry]
Type=Application
Name=Eclipse
Comment=Eclipse IDE
Icon=/opt/eclipse/icon.xpm
Exec=/opt/eclipse/eclipse_param.sh
Terminal=false
Categories=Development;IDE;Java;
StartupWMClass=Eclipse
Contents of /opt/eclipse/eclipse_param.sh
#!/bin/bash
export GIT_SSH=/usr/bin/ssh
/opt/eclipse/eclipse -showlocation
After these changes, everything worked as expected.

Related

No selectable SSH Agent in Eclipse 2020-12 (4.18.0)

I was looking into adding my RSA keys into Keychain in my mac (macOS Sierra if that matters). One of the things that I found was to use ssh-agents so that whenever you generate a key, it will get added automatically to Keychain.
The problem is that I can't see any agent in the SSH Agent list in Eclipse SSH2 settings window. Am I missing anything?
I saw this post Eclipse git and ssh-agent but the plugin is not maintained anymore. I can't seem to find a way to add the export statement into an init script as I'm not sure which file that is.
Thanks
Eclipse JGit can now work with the standard ssh-agent, so you need to run
ssh-add
on the command line of your Mac and provide the passphrase to your keys so the ssh-agent can load your keys and offer them to Eclipse over the socket.
This support is pretty new, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=541274 #howlger mentioned.
An earlier solution, which still works, is to set the GIT_SSH environment variable for Eclipse so that JGit uses the system SSH with the standard ssh-agent. The process to set environment variables for Applications in macOS is described here: Setting environment variables on eclipse

VS code Remote Development problem with SSH connection (Windows to Linux)

I'm Currently trying to setup Remote developement environment with VS code.
I have installed Remote - SSH plugin and edited my .ssh/config file as below
Host ABC
User ubuntu
HostName xx.xx.xx.xx
IdentityFile ~/.ssh/filename
It trowing an error by saying "An SSH Installation couldn't be found"
Local Machine - Windows
Host Machine - Ubuntu(Linux)
Please help on this matter
You are missing an SSH tool in your host machine. Popular implementation of SSH protocol, OpenSSH is installed by default in Windows 10. First confirm if you have OpenSSH client by going to
Windows Settings >> Apps & features >> Optional Features
If not, install OpenSSH client through "Add a feature" option at the optional features page.
Mostly VSCode can pick the executable from common installation locations of the ssh.exe. If still not able to resolve, add the property below in VSCode settings
"remote.SSH.path": "your/ssh.exe/path"
like
"remote.SSH.path": "C:\Windows\System32\OpenSSH"
I have Windows 10 - 1608 version and it doesen't exist OpenSSH Feature in >> Optional Features.
I had downlosded OpenSSH seporately and now it's working as expected.
and another mistake I have done. I have tried to connect with .ppk key as the IdentityFile. And I have converted to private key using puttyGen. It is working perfectly now
Thanks for the help guys. Openssh was not present so had to install OpenSSH from Windows Powershell
https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse
Then copied the path of ssh.exe to VScode settings. Ex:
"remote.SSH.path": "C:\Program Files\OpenSSH-Win64\ssh.exe"
It worked perfectly.
Instead of installing OpenSSH, installing Git on Windows 7 also works because Git for Windows installs the SSH client. It ships OpenSSH with the package.

Gitkraken, Linux Mint and ~/.ssh keys

Gitkraken: 6.0.0 installed via snap. Mint 19.1
I have started trying to use Gitkraken on Linux Mint. I dig that Mint is using GNU keyring or some-such by default but Gitkracken seems to ignore it as the "default" ssh agent. Command-line git ignores it as well.
If I start up a terminal window and start the openssh ssh-agent and then do an ssh-add of the keys in ~/.ssh I can then use command-line git just fine. If, in the same terminal window, I start Gitkraken it still will not recognize that I have ssh keys loaded.
If I go to Gk's settings and try to force it to use my ssh keys in ~/.ssh I am told that Gk does not have permissions to read the dir... it is running as me, I checked. It seems to prefer its own ssh dir in a snap config folder in my home dir. I can not change that as far as I know at this time.
what am I missing?
Edit
Addressing #kowsky's questions below in more detail:
I have tried setting gk's auth prefs: File -> Preferences -> Authentication. Under the General tab "use local ssh agent" is checked. Un-checking it offers me the opportunity to brows for ssh keys. By default Gk is pointing to an ssh dir under it's ~/snap/gitkraken/ dir. Navigating to my ~/.ssh dir yields a permission denied message.
My repo is on Bitbucket.org so I go to that tab and find that Gk "is connected" but trying to brows for ssh keys to add ends up with the same permission denied error.

Eclipse Mars Scrolling in Lubuntu

Just installed Eclipse Mars on Lubuntu 14.
While scrolling up and down in the console or editor - I get a kind of black rectangle covering some text, or the test is kind of twisted visually (lines become non-straight).
Anyone know how to fix this?
Haven't had this in previous versions of Eclipse on the same comp.
Exactly the same thing happened to me installing Eclipse Mars on Lubuntu 14 Toshiba Satellite notebook. I was really looking forward to the day of the Eclipse annual release of Mars and I was disappointed to be so disappointed with 5 minutes on installing.
Anyway, I can confirm that setting environment variable SWT_GTK3=0 by way of export does circumvent the problem. If you open a terminal and type "export SWT_GTK3=0" in the shell, you will also need to start Eclipse via the command line while remaining in the same shell. If you start Eclipse via a desktop launch icon, Eclipse will not see the SWT_GTK3 environment variable and the problem will persist. This is because environment variables in Linux are per-process and an application launched from the desktop is running in a different process to a shell process in a terminal.
So that Eclipse always sees the correct SWT_GTK3 environment variable after starting your machine, best you export SWT_GTK3=0 globally. To do this on Lubuntu, follow these steps:
Open a terminal window
Open the file /etc/profile for editing as sudo (e.g. sudo gedit /etc/profile)
Add the line
export SWT_GTK3=0
at the end of the file.
Save file, quit editor and reboot your machine.
Launch Eclipse Mars and hopefully your scrolling problem is fixed.
This worked for me but, as always, YMMV.
btw. You can check the SWT-GTK3 environment variable was exported after rebooting by opening a terminal window and typing the 'env' command. You should see
SWT_GTK3=0 in the list of environment variables and values that are displayed.
It seems like a new bug:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=469027
It happens also under Kubuntu. Anyway the workaround, at least for me, is to export the following environment variable:
SWT_GTK3=0
I solved my problem in Ubuntu 15.04 with Eclipse Mars by adding the following code in the start of data in the Exec option in eclipse.desktop (/home/.local/share/applications):
Exec=env UBUNTU_MENUPROXY=0 SWT_GTK3=0 /usr/lib/jvm/...
In that way you leave intact your OS preferences and act only on Eclipse starting script.

Eclipse: How to clone git over ssh with keyfile?

Hey, I am using Eclipse (while running Ubuntu 10.10) and would like to connect to a remote git. Normally I would use the egit plugin, but now I need to connect over ssh with keyfile.
Unfortunately egit has no "with keyfile" option, is there a way to connect to my repository with my keyfile?
Is there a "hidden" way to make Eclipse to pass parameters (-i keyfile) to ssh or something?
http://wiki.eclipse.org/EGit/User_Guide/Remote - I had to manually load my existing key in the "Key Management" tab.
I don't know anything about egit. But what you usually do is:
Start ssh-agent (mine is automatically started, when my window manager starts, so you have to google a bit how to setup it)
Run ssh-add [your key]
Use git over ssh as usual. It won't ask you for any passwords, since ssh-agent takes care of it.
HTH