Не работает ssh в GitLab

На моем одном компьютере команда ssh -T [email protected] работает и выводит Welcome to GitLab, Anonymous!.

Но в моем выводе команды двух ПК

$ ssh -vT [email protected]
OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Connecting to github.lcl.loc [192.168.1.104] port 22.
debug1: Connection established.
debug1: identity file /c/Documents and Settings/n.nozdrin-plotnickij.LCL/.ssh/id
entity type -1
debug1: identity file /c/Documents and Settings/n.nozdrin-plotnickij.LCL/.ssh/id
_rsa type 1
debug1: identity file /c/Documents and Settings/n.nozdrin-plotnickij.LCL/.ssh/id
_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.0p1 Debia
n-4+deb7u2
debug1: match: OpenSSH_6.0p1 Debian-4+deb7u2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'github.lcl.loc' is known and matches the RSA host key.
debug1: Found key in /c/Documents and Settings/n.nozdrin-plotnickij.LCL/.ssh/kno
wn_hosts:1
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /c/Documents and Settings/n.nozdrin-plotnickij.LCL/.
ssh/identity
debug1: Offering public key: /c/Documents and Settings/n.nozdrin-plotnickij.LCL/
.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /c/Documents and Settings/n.nozdrin-plotnickij.LCL/.
ssh/id_dsa
debug1: Next authentication method: password
[email protected]'s password:
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
[email protected]'s password:
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
[email protected]'s password:
debug1: Authentications that can continue: publickey,password
debug1: No more authentication methods to try.
Permission denied (publickey,password).

Я генерирую новый ключ RSA. Ничего не изменилось. Ключ создан без пароля.

Если ввести пароль от пользователя git, получите доступ к консоли от имени пользователя git.

GitLab v7.9.4 GitLab Shell 2.6.2 Установить без omnibus-gitlab...


person scientistnik    schedule 20.04.2015    source источник
comment
Есть ли на вашем ПК1 (тот, на котором он работает) файл %HOME%\.ssh\config? Или по умолчанию id_rsa(.pub) закрытый и открытый ключи ssh?   -  person VonC    schedule 20.04.2015
comment
Не файл конфигурации. Только открытый и закрытый ключ и known_hosts. ПК2 аналогично.   -  person scientistnik    schedule 20.04.2015
comment
У вас есть ключи id_rsa(.pub) на ПК2? С общедоступным (id_rsa.pub), опубликованным в вашем репозитории GitLab?   -  person VonC    schedule 20.04.2015
comment
Да. На ПК2 есть ключи. И публикуется в Gitlab. Но я заметил, что в файле /var/opt/gitlab/.ssh/authorized_keys не добавляется открытый ключ PC2.   -  person scientistnik    schedule 21.04.2015


Ответы (1)


ХОРОШО. Когда я заметил, что файл не добавляет ключи, я удалил файл /var/opt/gitlab/.ssh/authorized_keys и начал команду sudo gitlab-ctl reconfigure.

Этот файл создать. Через веб-интерфейс удаляю все ключи и добавляю их заново.

Это сработало!

person scientistnik    schedule 21.04.2015