Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to access gitlab with my account in SSH with public key authentication. I have uploaded my public key and here is my SSH configuration:

content of /home/$my_user/.ssh/config
Host gitlab
User git
Port 22
Hostname gitlab.$my_domain
IdentityFile /home/$my_user/.ssh/id_rsa
IdentitiesOnly yes

Here is the command I tiped:

mkdir $my_project
cd $my_project
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin gitlab:$my_user/$my_project.git
git push -u origin master

Here is the sshd log file: auth.log

Here is the stack on client side: client stack

As I am authenticated, and my key correctly loaded from ~git/.ssh/authorized_keys, I presume the trouble comes from the client side. But I cannot determine where the issue comes from and neither how to fix it.

Many thanks for your help; Don't hesitate to ask for more details if you need to.

EDIT: here is the output of ssh -v git@gitlab

share|improve this question
    
What is the output of "ssh -v git@gitlab" –  deagh Apr 27 at 14:43
    
Many thanks for your answer, I posted the pastbin link of the output of ssh -v git@gitlab as an edit of my post –  philippe Apr 27 at 15:14
    
Have you run rake gitlab:check as described at github.com/gitlabhq/gitlab-public-wiki/wiki/… and corrected any problems it finds? –  sciurus Apr 27 at 22:26

3 Answers 3

up vote 1 down vote accepted

The gitlab shell, which is invoked by your SSH login, needs to make a call to the API of the gitlab web application to determine if you're authorized to push. However, it can't connect to it. Run the appropriate rake task for your version of gitlab to check the configuration of all the gitlab components and fix any errors it finds.

share|improve this answer
    
Thanks for your answer which resolves the issue I was having. Running the rake task according to my gitlab version (sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production) shows that there was a trouble with my host which is named differently from inside or outside my network. I remapped it to always point to my internal hostname (/etc/hosts) and it worked :) –  philippe Apr 28 at 15:28

A 'Connection Refused' message generally means that there is no process listening on the IP:Port combination you are trying to connect to.

  • Confirm the ports that you are using.
  • Use netstat to check that processes are listening on the relevant IP:ports.
  • Check that you are not blocking the ports at your firewall.
share|improve this answer
    
Thanks for your answer; however SSH port is open, its banner shows up and ssh-server fingerprints get displayed; sciurus advice helped me understand that the different names associated to the server (from inside or outside the network) was causing the trouble. I have launched sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production which showed the error. –  philippe Apr 28 at 15:25
1  
@philippe I guess I was kinda right in that it wasn't listening on the IP:port you were connecting t ;) –  Iain Apr 28 at 16:03
    
You were totally right, but I couldn't retrieve the answer from it, I was convinced the issue would come from a network trouble; It was indeed a network issue, but caused by a wrong configuration. –  philippe Apr 29 at 8:54

The problem is due to git/https buffer settings. In order to solve it

  git config http.postBuffer somehugenumber

And run the command again

share|improve this answer
    
Thanks for your help; I have tried launching git config http.postBuffer 524288000; with same result :/ –  philippe Apr 27 at 16:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.