GitLab SSH克隆无法正常工作,但HTTP工作正常

时间:2014-12-17 11:32:01

标签: git nginx ssh gitlab

当尝试通过SSH克隆repo时,我遇到了Gitlab 7.5.0.rc1的问题(HTTP克隆工作正常)。

系统:

Linux debian 3.2.0-4-686-pae #1 SMP Debian 3.2.63-2+deb7u1 i686 GNU/Linux

Gitlab检查:http://pastebin.com/LDbJPqT8 克隆回购结果:

user@host:~/projects$ git clone git@mydomain.local:8081:user/my-test-project.git
Cloning into 'my-test-project'...
Enter passphrase for key '/home/user/.ssh/id_rsa': 
Access denied.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

尝试克隆repo时从/var/log/auth.log记录:

Dec 17 12:12:25 debian sshd[20504]: Accepted publickey for git from 192.168.1.54 port 41068 ssh2
Dec 17 12:12:25 debian sshd[20504]: pam_unix(sshd:session): session opened for user git by (uid=0)
Dec 17 12:12:25 debian sshd[20509]: Received disconnect from 192.168.1.54: 11: disconnected by user
Dec 17 12:12:25 debian sshd[20504]: pam_unix(sshd:session): session closed for user git

Gitlab正致力于nginx。 VH配置的一部分:

## Normal HTTP host
    server {
      listen *:8081; 
      server_name mydomain.local; 
      ...

权限:

root@debian:/home/git# ls -l
total 16
drwxr-xr-x 16 git git 4096 Nov 19 07:41 gitlab
drwxr-x---  3 git git 4096 Dec 17 11:13 gitlab-satellites
drwxr-xr-x  8 git git 4096 Dec 17 10:59 gitlab-shell
drwxrws---  4 git git 4096 Dec 17 08:05 repositories

在我写完这条消息之前,我真的经常搜索,但没有运气。正如您可以看到我已禁用LDAP并且网络上的许多线程都会讨论像ldap用户那样的事情。删除它并再次添加帮助'。但这不应该是一个问题吗?

请给我一些东西......

1 个答案:

答案 0 :(得分:0)

在git clone的后端,它正试图ssh到那台机器。我建议运行ssh -vvvv git@mydomain.local,它可能会为您提供有关该问题的更多信息。