Eclipse: How to clone git over ssh with keyfile? - eclipse

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

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

Emacs: magit status failed on ssh remote server repo

I'm using ssh to connect to a remote server. On the server there is a git repo called MRFLSSVM. However, when I execute magit-status on:
/ssh:qmServer:/home/Chang/qmCodeLab/MRFLSSVM/
Magit asks me to Create repository in /ssh:qmServer:/home/Chang/qmCodeLab/MRFLSSVM/?.
Any idea how to let magit recognize that repo? (I've already installed git 2.10.0 on /usr/local/git and configured my system (CentOS) to use it by update-alternatives)
-----------Edit------------------------------
Error (magit): Magit requires Git >= 1.9.4, you are using 1.8.3.
If this comes as a surprise to you, because you do actually have
a newer version installed, then that probably means that the
older version happens to appear earlier on the `$PATH'. If you
always start Emacs from a shell, then that can be fixed in the
shell's init file. If you start Emacs by clicking on an icon,
or using some sort of application launcher, then you probably
have to adjust the environment as seen by graphical interface.
For X11 something like ~/.xinitrc should work.
If you use Tramp to work inside remote Git repositories, then you
have to make sure a suitable Git is used on the remote machines
too.
Error (magit): Magit requires Git >= 1.9.4, but on /ssh:qmServer: the version is 1.8.3.
If multiple Git versions are installed on the host then the
problem might be that TRAMP uses the wrong executable.
First check the value of `magit-git-executable'. Its value is
used when running git locally as well as when running it on a
remote host. The default value is "git", except on Windows
where an absolute path is used for performance reasons.
If the value already is just "git" but TRAMP never-the-less
doesn't use the correct executable, then consult the info node
`(tramp)Remote programs'.
This problem seems to be tramp is not using the correct git on remote server. I've tried to change magit-git-executable to usr/local/git/bin/git which is the path both of my local and remotes installed git. But this still doesn't work.
Any ideas to solve this? Thanks!

Use specific SSH Key for a specific host in Eclipse like SSH Config in Linux?

I am using Eclipse since years (Ubuntu and Windows in parallel), and the projects are growing...
However, I am using many remote GIT repositories with SSH Keys that are protected by passphrases.
My problem is that Eclipse asks me for all passphrases every time I want to push to a server, which is very annoying. And I can't find a way to tell Eclipse which SSH Key belongs to which host.
Can anybody help me?

EGit not remembering SSH passphrase

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.

How to pass ssh password asked on terminal while using subclipse

Our internal svn repository's URI looks like svn+ssh://svn/hogehoge/svnroot/. Using subclipse on eclipse that is run from a terminal, eclipse freezes when I try to access repository and never return. I found on terminal ssh password is asked but looks like it's just printed there and doesn't accept my input (password I enter is interpreted as command on terminal). Any idea is appreciated.
Environment:
Ubuntu 10.04
Eclipse Indigo SP2
Subclipse (Required) 1.6.18
Subversion Client Adapter (Required) 1.6.12
Subversion JavaHL Native Library Adapter (Required) 1.6.17
I would recommend you install SVNKit and change to using it instead of JavaHL. SVNKit includes a pure Java SSH client so it is able to provide a GUI prompt within Eclipse. There are two alternatives if you want to use JavaHL:
Start Eclipse from a Terminal window. SSH prompts will then appear within that window.
Run ssh-agent. Your SSH client will then fetch the keys from ssh-agent and will not need the terminal prompt.
Usually users are already using ssh-agent, in which case I would recommend just using JavaHL. Since you are apparently not using it, I would suggest to just use SVNKit.