Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker - Gitlab container. SSH git login error

I have a Docker container with a Gitlab application. When i execute a git clone/push/pull the command not work and output this message: "fatal protocol error bad line length character: Welc"

The server response is not the response expected by git (it is a response for a common ssh connection).

This occurs because there is an error during the connection, see:

 Mar 20 14:55:31 gitlab sshd[7934]: reverse mapping checking getaddrinfo for XXXX.XXXX.XXX.XX.static.host.gvt.net.br [XXXX.XXXX.XXX.XX] failed - POSSIBLE BREAK-IN ATTEMPT!
 Mar 20 14:55:32 gitlab sshd[7934]: Accepted publickey for git from XXXX.XXXX.XXX.XX port XXXX ssh2
 Mar 20 14:55:32 gitlab sshd[7934]: pam_loginuid(sshd:session): set_loginuid failed
 Mar 20 14:55:32 gitlab sshd[7934]: pam_unix(sshd:session): session opened for user git by (uid=0)
 Mar 20 14:55:32 gitlab sshd[7934]: pam_env(sshd:session): Unable to open env file: /etc/default/locale: No such file or directory
 Mar 20 14:55:32 gitlab sshd[7934]: error: PAM: pam_open_session(): Cannot make/remove an entry for the specified session

Info

  • GitLab version: 6.6.5
  • Docker version: 9.0
  • Host: Ubuntu 13.10
  • Container: Ubuntu 13.10

I think i need to enable something in my Docker container because outside a Docker container the gitlab works correctly.

How to fix this? Thanks!

like image 386
Renan Vaz Avatar asked Mar 21 '14 00:03

Renan Vaz


Video Answer


1 Answers

I fix this following this article: http://www.linuxweblog.com/blogs/sandip/20090203/setloginuid-failed-opening-loginuid

Just comment this line in file "/etc/pam.d/sshd":

session required        pam_loginuid.so
like image 183
Renan Vaz Avatar answered Oct 05 '22 07:10

Renan Vaz