title: Gitlab: Cloning (via ssh) on a fresh install fails with "The remote end hung up unexpectedly"
body: <h1>The problem</h1>
  
  <p>Gitlab 5.3stable</p>
  
  <p>I have made a fresh install on my Debian 7.0 server. Everything seems to work fine, except that when I'm about to clone an existing project: </p>
  
  <pre><code>$ git clone gitlab:root/fastalook.git
  Cloning into 'fastalook'...
  Debian GNU/Linux 7
  fatal: The remote end hung up unexpectedly
  </code></pre>
  
  <p>Even though ssh:ing works without a problem: </p>
  
  <pre><code>$ ssh gitlab
  Debian GNU/Linux 7
  PTY allocation request failed on channel 0
  Welcome to GitLab, Anonymous!
  Connection to gitlab.rzetterberg.se closed.
  </code></pre>
  
  <p>Cloning/push via http works fine:</p>
  
  <pre><code>$ git clone http://gitlab.rzetterberg.se:666/root/fastalook.git
  Cloning into 'fastalook'...
  Username for 'http://gitlab.rzetterberg.se:666': root          
  Password for 'http://root@gitlab.rzetterberg.se:666':
  remote: Counting objects: 1589, done.
  remote: Compressing objects: 100% (621/621), done.
  remote: Total 1589 (delta 884), reused 1589 (delta 884)
  Receiving objects: 100% (1589/1589), 1.65 MiB | 1.39 MiB/s, done.
  Resolving deltas: 100% (884/884), done.
  </code></pre>
  
  <h1>Configuration</h1>
  
  <h2>Ssh config</h2>
  
  <pre><code>Host gitlab
      Hostname gitlab.rzetterberg.se
      Port 22000
      User git
  </code></pre>
  
  <h2>Check output</h2>
  
  <pre><code>$ bundle exec rake gitlab:check RAILS_ENV=production
  WARNING: Nokogiri was built against LibXML version 2.7.8, but has dynamically loaded 2.8.0
  Checking Environment ...
  
  Git configured for git user? ... yes
  Has python2? ... yes
  python2 is supported version? ... yes
  
  Checking Environment ... Finished
  
  Checking GitLab Shell ...
  
  GitLab Shell version &gt;= 1.4.0 ? ... OK (1.4.0)
  Repo base directory exists? ... yes
  Repo base directory is a symlink? ... no
  Repo base owned by git:git? ... yes
  Repo base access is drwxrws---? ... yes
  post-receive hook up-to-date? ... yes
  post-receive hooks in repos are links: ... 
  Richard Zetterberg / Fastalook ... ok
  
  Checking GitLab Shell ... Finished
  
  Checking Sidekiq ...
  
  Running? ... yes
  
  Checking Sidekiq ... Finished
  
  Checking GitLab ...
  
  Database config exists? ... yes
  Database is SQLite ... no
  All migrations up? ... WARNING: Nokogiri was built against LibXML version 2.7.8, but has dynamically loaded 2.8.0
  yes
  GitLab config exists? ... yes
  GitLab config outdated? ... no
  Log directory writable? ... yes
  Tmp directory writable? ... yes
  Init script exists? ... yes
  Init script up-to-date? ... yes
  Projects have satellites? ... 
  Richard Zetterberg / Fastalook ... yes
  Redis version &gt;= 2.0.0? ... yes
  Your git bin path is "/usr/bin/git"
  Git version &gt;= 1.7.10 ? ... yes (1.7.10)
  
  Checking GitLab ... Finished
  </code></pre>
  
  <h2>Env:info output</h2>
  
  <pre><code>git@paralyzed:~/gitlab$ bundle exec rake gitlab:env:info RAILS_ENV=production
  WARNING: Nokogiri was built against LibXML version 2.7.8, but has dynamically loaded 2.8.0
  
  System information
  System:         Debian 7.1
  Current User:   git
  Using RVM:      no
  Ruby Version:   1.9.3p392
  Gem Version:    1.8.23
  Bundler Version:1.3.5
  Rake Version:   10.0.4
  
  GitLab information
  Version:        5.3.0
  Revision:       0c39f4d
  Directory:      /home/git/gitlab
  DB Adapter:     mysql2
  URL:            http://gitlab.rzetterberg.se:666
  HTTP Clone URL: http://gitlab.rzetterberg.se:666/some-project.git
  SSH Clone URL:  git@gitlab.rzetterberg.se:some-project.git
  Using LDAP:     no
  Using Omniauth: no
  
  GitLab Shell
  Version:        1.4.0
  Repositories:   /home/git/repositories/
  Hooks:          /home/git/gitlab-shell/hooks/
  Git:            /usr/bin/git
  </code></pre>
  
  <h2>Gitlab config</h2>
  
  <pre><code>production: &amp;base
    gitlab:
      host: gitlab.rzetterberg.se
      port: 666
      https: false
      email_from: gitlab@gitlab.rzetterberg.se
      support_email: support@gitlab.rzetterberg.se
      default_projects_limit: 10
      default_projects_features:
        issues: true
        merge_requests: true
        wiki: true
        wall: false
        snippets: false
  
    gravatar:
      enabled: true                 # Use user avatar image from Gravatar.com (default: true)
  
    satellites:
      path: /home/git/gitlab-satellites/
  
    backup:
      path: "tmp/backups"   # Relative paths are relative to Rails.root (default: tmp/backups/)
  
    gitlab_shell:
      repos_path: /home/git/repositories/
      hooks_path: /home/git/gitlab-shell/hooks/
  
      upload_pack: true
      receive_pack: true
  
    git:
      bin_path: /usr/bin/git
      max_size: 5242880 # 5.megabytes
      timeout: 10
  
    extra:
  
  development:
    &lt;&lt;: *base
  
  test:
    &lt;&lt;: *base
    issues_tracker:
      redmine:
        project_url: "http://redmine/projects/:issues_tracker_id"
        issues_url: "http://redmine/:project_id/:issues_tracker_id/:id"
        new_issue_url: "http://redmine/projects/:issues_tracker_id/issues/new"
  
  staging:
    &lt;&lt;: *base
  </code></pre>
  
  <p><strong>Edit: Add output of /home/git/.ssh/authorized_keys and key in gitlab profile</strong></p>
  
  <h2>Gitlab key in profile</h2>
  
  <pre><code>ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCwiQfkb9LpHP1yI1ffGfuXYMmRiW7nBmRW9q7keLphmjvxpMcwFLtANfMIxhXE6wxBpJewtJkP1Gdye8awYknm2Mk5c/Yal67KL4SL0RIT+XTrcT8Y6c+5MSOSd5R0o/3ohxRMXVO7Wg4PIB//uSaG9LZvduIaxONdV8y7Qs5kp7vFXZ6KS+5Qcksy4vqzivgTqdjtqU9b2fXBu8nd7SmYxdzKML8HUi7To5Y15Z0LzuJDxtgz6wHMLz3m4cOS9rb2zJZ3toii4wdJnYigHkoYxOnk0p6gPmbM0bxOEJKSpPp5BUUpwbLL+SJYlyn8FaaSeEzfmKbsH0ucoboPOgXD zed@shinigami
  </code></pre>
  
  <h2>Authorized keys</h2>
  
  <pre><code>command="/home/git/gitlab-shell/bin/gitlab-shell key-1",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCwiQfkb9LpHP1yI1ffGfuXYMmRiW7nBmRW9q7keLphmjvxpMcwFLtANfMIxhXE6wxBpJewtJkP1Gdye8awYknm2Mk5c/Yal67KL4SL0RIT+XTrcT8Y6c+5MSOSd5R0o/3ohxRMXVO7Wg4PIB//uSaG9LZvduIaxONdV8y7Qs5kp7vFXZ6KS+5Qcksy4vqzivgTqdjtqU9b2fXBu8nd7SmYxdzKML8HUi7To5Y15Z0LzuJDxtgz6wHMLz3m4cOS9rb2zJZ3toii4wdJnYigHkoYxOnk0p6gPmbM0bxOEJKSpPp5BUUpwbLL+SJYlyn8FaaSeEzfmKbsH0ucoboPOgXD zed@shinigami
  </code></pre>