3

制作时:

sudo git clone git@gitlab.mydomain.com:ws.git

我收到一个错误:

> sudo git clone git@gitlab.mydomain.com:root/ws.git
Password:
Cloning into 'ws'…
The authenticity of host 'gitlab.mydomain.com (x.x.x.x)' can't be established.
RSA key fingerprint is xx:xx:xx…xx:xx.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'gitlab.mydomain.com,x.x.x.x' (RSA) to the list of known hosts.
git@gitlab.mydomain.com's password: 
Permission denied, please try again.
git@gitlab.mydomain.com's password: 
fatal: 'root/ws.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

即使我更改网址:

> sudo git clone git@gitlab.mydomain.com:ws.git
Password:
Cloning into 'ws'…
git@gitlab.mydomain.com's password: 
fatal: 'ws.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

问题是什么?

公共克隆有问题吗?我只能克隆添加个人 ssh 密钥吗?

更新:

添加了个人 ssh 密钥:

现在:

ssh -Tvvv root@gitlab.mydomain.com
OpenSSH_5.6p1, OpenSSL 0.9.8x 10 May 2012
debug1: Reading configuration data /Users/user/.ssh/config
debug1: Applying options for gitlab.mydomain.com
debug1: Reading configuration data /etc/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to gitlab.mydomain.com[x.x.x.x] port 22.
debug1: Connection established.
debug3: Not a RSA1 key file /Users/user/.ssh/root_gitlab.mydomain.com.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'Proc-Type:'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'DEK-Info:'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /Users/user/.ssh/root_gitlab.mydomain.com.de type 1
debug1: identity file /Users/user/.ssh/root_gitlab.mydomain.com-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.0p1 Debian-4
debug1: match: OpenSSH_6.0p1 Debian-4 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.6
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug2: kex_parse_kexinit: diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,ssh-rsa-cert-v00@openssh.com,ssh-dss-cert-v00@openssh.com,ssh-rsa,ssh-dss
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: none,zlib@openssh.com,zlib
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: kex_parse_kexinit: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1
debug2: kex_parse_kexinit: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,aes256-cbc,arcfour,rijndael-cbc@lysator.liu.se
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-sha2-256,hmac-sha2-256-96,hmac-sha2-512,hmac-sha2-512-96,hmac-ripemd160,hmac-ripemd160@openssh.com,hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: mac_setup: found hmac-md5
debug1: kex: server->client aes128-ctr hmac-md5 none
debug2: mac_setup: found hmac-md5
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug2: dh_gen_key: priv key bits set: 119/256
debug2: bits set: 499/1024
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug3: check_host_in_hostfile: host gitlab.mydomain.com filename /Users/user/.ssh/known_hosts
debug3: check_host_in_hostfile: host gitlab.mydomain.com filename /Users/user/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 43
debug3: check_host_in_hostfile: host x.x.x.x filename /Users/user/.ssh/known_hosts
debug3: check_host_in_hostfile: host x.x.x.x filename /Users/user/.ssh/known_hosts
debug3: check_host_in_hostfile: match line 38
debug1: Host 'gitlab.mydomain.com' is known and matches the RSA host key.
debug1: Found key in /Users/user/.ssh/known_hosts:43
debug2: bits set: 511/1024
debug1: ssh_rsa_verify: signature correct
debug2: kex_derive_keys
debug2: set_newkeys: mode 1
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug2: set_newkeys: mode 0
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug2: key: /Users/user/.ssh/id_rsa (0x105725350)
debug2: key: /Users/user/.ssh/root_gitlab.mydomain.com (0x105724510)
debug1: Authentications that can continue: publickey,password
debug3: start over, passed a different list publickey,password
debug3: preferred gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/user/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password
debug1: Offering RSA public key: /Users/user/.ssh/root_gitlab.mydomain.com
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
root@gitlab.mydomain.com's password:

问题是什么?

更新2:

这个 [ SSH 密钥要求输入密码] 不起作用

更新3:

> sudo git clone --verbose git@gitlab.mydomain.com:ws.git
Cloning into 'ws'...
fatal: The remote end hung up unexpectedly
4

2 回答 2

1

从github 上的 gitlabhq 问题中找到了解决方案:

查看您的 puma 或 unicorn 服务器配置:

须藤纳米/home/git/gitlab/config/puma.rb

在那里阅读一个绑定的 url(有趣的是端口 - 在我的情况下它是 9292// 我将绑定变体从 unix 管道更改为http://0.0.0.0:9292前一段时间)

适当更改 gitlab-shell 中的 config.yml:

须藤纳米/home/git/gitlab-shell/config.yml

重启 gitlab 服务:

须藤服务 gitlab 重启

(我不知道,但我也重新启动了 apache sudo service apache2 restart:)

完毕:

现在,只需从项目页面复制 url 并执行以下操作:

git clone your-gitlab-url

于 2013-07-31T14:32:32.177 回答
0

我确实遇到了这个问题,并且只能通过反复试验找到答案。

> sudo git clone --verbose git@gitlab.mydomain.com:ws.git
Cloning into 'ws'...
fatal: The remote end hung up unexpectedly

事实证明,gitlab 不喜欢 2048 位 SSH 密钥。我将 SSH 密钥更改为 4096 位,它工作正常。我不知道这是 sshd 配置的结果还是什么,但这对我有用。

于 2014-01-30T00:32:29.183 回答