Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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:

  1. without password filled in, I got the response: Auth fail: Invalid password or missing SSH key.
  2. with my password filled in (but git username), I got the response:

    Auth fail: Invalid password or missing SSH key.
    
  3. 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?

like image 255
lippoliv Avatar asked Jan 09 '14 08:01

lippoliv


2 Answers

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.

Bitbucket ssh uri selection

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

Regards...

like image 62
Bahadir Tasdemir Avatar answered Oct 18 '22 08:10

Bahadir Tasdemir


Recently, I did have similar issues with GitLab but fixed it with:

First, I generated the ssh-rsa by using the MAC-OSX CLI and exported to GitLab. Git CLIs were working but no luck from Eclipse.

Then, I went to Eclipse > Preferences... > General > Network Connections > SSH2, Key Management tab, I regenerated the key from Eclipse but using the "Generate RSA key..." button. It had "RSA-1024" at the end, and exported to GitLab.

like image 39
JohnRossy Avatar answered Oct 18 '22 07:10

JohnRossy