【问题标题】:gitolite installation: I cannot clone gitolite-admin repo!gitolite 安装:我无法克隆 gitolite-admin 存储库!
【发布时间】:2011-09-16 00:27:39
【问题描述】:

我正在尝试在我的 ubuntu 服务器机器上安装 gitolite。

仍然有很多我不知道的事情,但我正在按照它的指示非常缓慢地前进(http://sitaramc.github.com/gitolite/doc/1-INSTALL.html) .

  1. 我的服务器帐户是“yoon”,并使用 ssh-keygen 命令生成密钥对,无需密码(只需按 Enter)。然后,将公钥复制到 /tmp 目录并 chmod 777。
  2. 使用 'sudo apt-get install gitolite' 安装 gitolite,它还创建了 gitolite 帐户。(输出的最后一行是 没有给出管理员密钥 - 没有在 /var/lib/gitolite 中初始化 gitolite。
  3. 使用“sudo su gitolite”更改用户并执行“gl-setup /tmp/id_rsa.pub”。
  4. 返回我的帐户(yoon)并运行“git clone gitolite@myserver.com:gitolite-admin”,然后它会询问 gitolite@yoonha.iptime.org 的密码
  5. 如果我在创建密钥对时没有输入任何密码而按回车,终端会提示权限被拒绝,请重试

请让我提供任何线索~ 谢谢!

+ 我使用与服务器和客户端相同的处理方式。

+ ssh -vvv 命令的完整列表

yoon@ubuntu:~$ ssh -vvv gitolite@myserver.com
OpenSSH_5.5p1 Debian-4ubuntu5, OpenSSL 0.9.8o 01 Jun 2010
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to myserver.com [xxx.xxx.xxx.xxx] port 22.
debug1: Connection established.
debug3: Not a RSA1 key file /home/yoon/.ssh/id_rsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
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 /home/yoon/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /home/yoon/.ssh/id_rsa-cert type -1
debug1: identity file /home/yoon/.ssh/id_dsa type -1
debug1: identity file /home/yoon/.ssh/id_dsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.5p1 Debian-4ubuntu5
debug1: match: OpenSSH_5.5p1 Debian-4ubuntu5 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.5p1 Debian-4ubuntu5
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-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: 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
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
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: 126/256
debug2: bits set: 503/1024
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug3: check_host_in_hostfile: host myserver.com filename /home/yoon/.ssh/known_hosts
debug3: check_host_in_hostfile: host myserver.com filename /home/yoon/.ssh/known_hosts
debug3: check_host_in_hostfile: host myserver.com filename /etc/ssh/ssh_known_hosts
debug3: check_host_in_hostfile: host myserver.com filename /etc/ssh/ssh_known_hosts
debug3: check_host_in_hostfile: host xxx.xxx.xxx.xxx filename /home/yoon/.ssh/known_hosts
debug3: check_host_in_hostfile: host xxx.xxx.xxx.xxx filename /home/yoon/.ssh/known_hosts
debug3: check_host_in_hostfile: host xxx.xxx.xxx.xxx filename /etc/ssh/ssh_known_hosts
debug3: check_host_in_hostfile: host xxx.xxx.xxx.xxx filename /etc/ssh/ssh_known_hosts
debug3: check_host_in_hostfile: host myserver.com filename /home/yoon/.ssh/known_hosts
debug3: check_host_in_hostfile: host myserver.com filename /etc/ssh/ssh_known_hosts
debug2: no key of type 0 for host myserver.com
debug3: check_host_in_hostfile: host myserver.com filename /home/yoon/.ssh/known_hosts2
debug3: check_host_in_hostfile: host myserver.com filename /etc/ssh/ssh_known_hosts2
debug3: check_host_in_hostfile: host myserver.com filename /home/yoon/.ssh/known_hosts
debug3: check_host_in_hostfile: host myserver.com filename /etc/ssh/ssh_known_hosts
debug2: no key of type 2 for host myserver.com
The authenticity of host 'myserver.com (xxx.xxx.xxx.xxx)' can't be established.
RSA key fingerprint is d4:5d:af:76:51:63:42:7d:ed:43:5f:bf:17:c6:c3:d4.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'myserver.com,xxx.xxx.xxx.xxx' (RSA) to the list of known hosts.
debug2: bits set: 503/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: /home/yoon/.ssh/id_rsa (0x7fc8e9b596b0)
debug2: key: /home/yoon/.ssh/id_dsa ((nil))
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 public key: /home/yoon/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/yoon/.ssh/id_dsa
debug3: no such identity: /home/yoon/.ssh/id_dsa
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
gitolite@myserver.com's password:
debug3: packet_send2: adding 64 (len 53 padlen 11 extra_pad 64)
debug2: we sent a password packet, wait for reply
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
gitolite@myserver.com's password:
debug3: packet_send2: adding 64 (len 53 padlen 11 extra_pad 64)
debug2: we sent a password packet, wait for reply
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
gitolite@myserver.com's password:
debug3: packet_send2: adding 64 (len 53 padlen 11 extra_pad 64)
debug2: we sent a password packet, wait for reply
debug1: Authentications that can continue: publickey,password
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey,password).

【问题讨论】:

    标签: gitolite


    【解决方案1】:

    终于,我得到了自己的答案!

    gitolite devian包gitolite自动创建的用户不允许sshd登录。所以我在 sshd_config 文件中将 gitolite 添加到 AllowUsers。

    哇~~~

    【讨论】:

    • 这个解决方案对我有用,因为我的服务器上没有 permitrootlogin。对于那些想尝试这个解决方案但不知道该怎么做的人,“sudo nano /etc/ssh/sshd_config”然后添加到底部“AllowUsers gitolite”而不带引号
    • 现在它可以工作了,你的 .ssh/authorized_keys 文件和 gitolite 信息和 .gitosis-admin 目录是否在 /home/gitosis 或 /root 中?我遇到了与您相同的问题,但修复不起作用,并且这些已为我扎根,似乎它们应该处于 gitosis 中。
    • 在我的机器 (synology) 上,我将用户 git/etc/passwd 的 shell-entry 更改为 /bin/sh 而不是 /sbin/nologin
    【解决方案2】:

    每当基于 ssh 的操作要求输入密码时,很可能是因为:

    • (监听您的请求的 ssh 守护程序)在 ~gitolite/.ssh/authorized_keys 文件中找不到公钥。
      在 Gitolite 安装 package method 中,这就是 gl-setup 应该做的(第 91+ 行)
      检查您是否正确填写并保护了~gitolite/.ssh/authorized_keys

    • 或者您的私钥 (id_rsa) 不在应有的位置(在您自己的 $HOME/.ssh 中)

    【讨论】:

    • 1. [command="/usr/share/gitolite/gl-auth-command id_rsa",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa blahblah... myaccount@myserver ] 存在于 ~gitolite/.ssh.authorized_keys 文件 2 中。我在客户端的 .ssh 目录中有 id_rsa 和 id_rsa.pub。
    • @Hongseok:ssh -vvv gitolite@myserver.com 返回(完整)什么?这应该列出 ssh 尝试识别您的行为。
    • 我刚刚发布了编辑我的 Q 的结果,非常感谢!
    • @Hongseok:嗯...也许bbs.archlinux.org/viewtopic.php?id=55471 可以提供帮助。尝试重新创建您的密钥(公钥和私钥,并通过gl-setup 重新发布您的私钥)。如果它仍然不起作用,我提到的线程谈论sshd_config 文件,这也可以解释你的错误消息。
    • @Hongseok:例如,上面的线程提到:“至少对我来说,这个错误是由于我的/etc/hosts.allow/etc/hosts/deny不允许sshd访问sshd。显然我只是把“ sshd : ALL" in /etc/hosts.allow 并且它开始工作了。"
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-07-01
    • 1970-01-01
    • 2019-02-17
    • 2013-04-16
    • 1970-01-01
    • 2011-06-29
    • 1970-01-01
    相关资源
    最近更新 更多