Установка gitolite: я не могу клонировать репозиторий gitolite-admin!

Я пытаюсь установить gitolite на свой сервер Ubuntu.

тем не менее, я еще многого не знаю, но я очень медленно продвигаюсь вперед, следуя его инструкциям (http://sitaramc.github.com/gitolite/doc/1-INSTALL.html).

  1. моя учетная запись сервера — «yoon», и я сгенерировал пару ключей с помощью команды ssh-keygen без пароля (просто нажмите Enter). затем скопируйте открытый ключ в каталог /tmp и выполните команду chmod 777.
  2. установите gitolite, используя «sudo apt-get install gitolite», и он также создал учетную запись gitolite. (последняя строка вывода была Ключ администратора не указан — gitolite не инициализируется в /var/lib/gitolite.)
  3. смените пользователя, используя «sudo su gitolite» и exec «gl-setup /tmp/id_rsa.pub».
  4. вернитесь в мою учетную запись (yoon) и запустите «git clone [email protected]:gitolite-admin», а затем запросит пароль [email protected].
  5. Если я нажму Enter, потому что не ввел пароль при создании пары ключей, терминал скажет, что Отказано в доступе, попробуйте еще раз.

Пожалуйста, позвольте мне дать любую подсказку ~ СПАСИБО!

+ Я использую одну и ту же обработку в качестве сервера и клиента.

+ полный список команды ssh -vvv

yoon@ubuntu:~$ ssh -vvv [email protected]
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: [email protected],[email protected],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,[email protected]
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,[email protected]
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,[email protected],zlib
debug2: kex_parse_kexinit: none,[email protected],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,[email protected]
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,[email protected]
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,[email protected],hmac-sha1-96,hmac-md5-96
debug2: kex_parse_kexinit: none,[email protected]
debug2: kex_parse_kexinit: none,[email protected]
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
[email protected]'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.
[email protected]'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.
[email protected]'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).

person Hongseok Yoon    schedule 16.06.2011    source источник


Ответы (2)


Наконец-то я получил ответ от себя!

Пользователь gitolite, автоматически созданный пакетом gitolite от Devian, не может войти в систему с помощью sshd. поэтому я добавил gitolite в AllowUsers в файле sshd_config.

Вью~~~

person Hongseok Yoon    schedule 15.12.2011
comment
Это решение сработало для меня, так как на моем сервере не было разрешения rootlogin. для тех, кто хочет попробовать это решение, но не знает, что делать, sudo nano /etc/ssh/sshd_config затем добавьте внизу gitolite AllowUsers без кавычек - person matthewdaniel; 23.03.2012
comment
Теперь, когда это работает, ваш файл .ssh/authorized_keys с информацией о gitolite и каталогами .gitosis-admin находится в /home/gitosis или в /root? Я столкнулся с той же проблемой, что и вы, но исправление не работает, и они были помещены в root для меня, и кажется, что они должны были быть в gitosis. - person sak; 18.04.2012
comment
На моей машине (Synology) я изменил запись оболочки /etc/passwd пользователя git на /bin/sh вместо /sbin/nologin. - person Patrick B.; 09.03.2016

Всякий раз, когда операция на основе ssh запрашивает пароль, это, вероятно, потому, что она:

  • (демон ssh, который прослушивает ваш запрос) не находит открытые ключи в ~gitolite/.ssh/authorized_keys файле.
    В установке Gitolite метод пакета, то есть gl-setup должен делать (строка 91+)
    Убедитесь, что ~gitolite/.ssh/authorized_keys правильно заполнено и защищено.

  • или ваш закрытый ключ (id_rsa) находится не там, где должен быть (в вашем собственном $HOME/.ssh)

person VonC    schedule 16.06.2011
comment
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. У меня есть id_rsa и id_rsa.pub в каталоге .ssh моего клиента. - person Hongseok Yoon; 16.06.2011
comment
@Hongseok: что возвращает ssh -vvv [email protected] (полностью)? Здесь должно быть указано, что делает ssh, чтобы попытаться идентифицировать вас. - person VonC; 16.06.2011
comment
Я только что опубликовал результат редактирования моего вопроса, очень ценю это! - person Hongseok Yoon; 16.06.2011
comment
@Hongseok: ммм... может быть, bbs.archlinux.org/viewtopic.php?id= 55471 может помочь. Попробуйте заново создать свои ключи (открытый и закрытый, а также повторно опубликовать закрытый ключ через gl-setup). Если это все еще не работает, в теме, о которой я упоминаю, говорится о файле sshd_config, что также может объяснить ваше сообщение об ошибке. - person VonC; 16.06.2011
comment
@Hongseok: например, в теме выше упоминается: по крайней мере, для меня эта ошибка была вызвана тем, что мои /etc/hosts.allow и /etc/hosts/deny не разрешали sshd доступ к sshd. Очевидно, я просто поставил sshd : ALL в /etc/hosts.allow, и он начал работать. - person VonC; 16.06.2011
comment
@Hongseok: убедитесь, что вы сгенерировали ключи rsa (unix.com/red-hat/). Относительно моего предыдущего комментария о host.allow: bbs.archlinux.org/viewtopic.php?pid =422485 (другая иллюстрация) - person VonC; 16.06.2011
comment
@Hongseok: жаль это читать. Базовая команда ssh — это первый шаг, который необходимо решить для успешной установки и интеграции gitolite. Я надеюсь, что вы найдете решение. - person VonC; 16.06.2011
comment
Я получаю некоторую подсказку ... установка пакета Ubuntu создает пользователя gitolite, а команда клонирования запрашивает пароль для gitolite, а не для пароля. если я готовлю репо, используя другую учетную запись, все работает нормально. тогда какой пароль для gitolite? Я даже сменил его пароль, но все же... Сообщение об отказе в доступе начинает рвать. :( - person Hongseok Yoon; 17.06.2011
comment
плюс ..., если для учетной записи gitolite требуется пароль, должен ли администратор делиться им со всеми другими пользователями? не только открытый ключ? - person Hongseok Yoon; 17.06.2011
comment
@Hongseok: нет, пароль не должен требоваться, и им никогда нельзя делиться. Одним из объяснений может быть то, что вы ввели фразу-пароль при создании открытого/закрытого ключа учетной записи gitolite. - person VonC; 17.06.2011