GitLab + Eclipse + SSH - "Auth failed" or "cannot open git-upload-pack"

authentication, eclipse, git, gitlab, ssh

Solution

From my answer from here:

I faced the same issue while migrating my project from github to bitbucket and this is how I resolved it:

Introduction: I will describe the ssh key usage here. A user generates a unique key to connect to remote machines using ssh. So you can create it locally. After, user uploads the keys to the remote machines where want to connect without password and more securely. On Git, the same thing happens, user creates a ssh key and uploads the generated key value to the git system providers like Github or Birbucket. After uploading your unique key, you must configure your development environment to let your git system provider communicate providing security over ssh key.

1) I was using ssh key to push my commits to remote with github in eclipse, the ssh key is set at `window -> preferences -> General -> Network Connections -> SSH2` for eclipse (on git pushes, this ssh key is used if set). If you do not have any ssh keys on your machine then follow this article to generate one for you and set it into eclipse at the path above.

2) In your github or bitbucke account, find the screen where you can save your ssh key. For bitbucket, it is at https://bitbucket.org/account/user/[user-name]/ssh-keys/. '[user-name]' here is your user name at bitbucket. Open your 'id_dsa.pub' file (where you generated your ssh key) with a text editor, select all, copy and paste into your github/bitbucket accounts' ssh key addition section and then click add.

3) At eclipse, be sure to use the 'ssh' GIT URI for your project. Go to `Window -> Preferences -> Team -> Git -> Configuration`, click '`Repository Settings`' tab and paste your GIT ssh URI to `remote.origin.url`.

4) Finally try to push your commits to remote. You mustn't face any errors, if you have please comment under my answer.

Regards...

Problem

This week I set up an new GitLab server. It is running. Yesterday I forced him to be reachable via HTTPS for secure communication. In Eclipse I generated an RSA-Key via the preferences. But if I try to import an Git-Project (`git@DOMAIN:GROUP/PROJECT.git`) then: - without password filled in, I got the response: Auth fail: Invalid password or missing SSH key. with my password filled in (but git username), I got the response: ``` Auth fail: Invalid password or missing SSH key. ``` with my user & password, I got the response: ``` Auth fail: Invalid password or missing SSH key. ``` Via HTTPS I get the response: ``` cannot open git-upload-pack ``` Please, what do I don't see?

Original source

Related problems