Я использую версию GitLab, которую я установил прошлой осенью. К сожалению, я не могу определить номер версии. Он размещен на Ubuntu 1404 в виртуальной машине на хосте Win10. ОБНОВЛЕНИЕ: похоже на версию 9.4.3-ce.0 и является последней доступной на серверах пакетов Ubuntu.
Я восстанавливаюсь после аварии, которая потребовала холодной переустановки Win10. У меня есть VM и работает в VirtualBox. Кажется, мои учетные данные для входа в GitLab работают нормально - я могу войти на сервер и клонировать свои проекты, используя http. Что я не могу сделать, так это получить доступ к серверу через ssh. Я должен добавить, что до катастрофы все работало просто отлично.
Из msys bash я могу просто войти в виртуальную машину ssh, но все попытки получить доступ к GitLab через ssh приводят к следующему:
$ git push origin dev-5-1-0
fatal: 'git@elm-ub1404/xxx/program.git' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Я проверил, что ключ в настройках /ssh-keys GitLab является правильным. Я даже удалил его, а затем добавил обратно, но безрезультатно.
Файл журнала gitlab-shell.log содержит следующее:
W, [2017-08-07T22:58:00.754776 #23099] WARN -- : gitlab-shell: Attempt to execute disallowed command <git receive-pack 'user/program.git'> by user with key key-1.
W, [2017-08-07T23:03:07.060909 #23937] WARN -- : gitlab-shell: Attempt to execute disallowed command <git receive-pack 'user/program.git'> by user with key key-1.
W, [2017-08-07T23:05:51.418158 #24333] WARN -- : gitlab-shell: Attempt to execute disallowed command <git receive-pack 'user/pruProgram.git'> by user with key key-1.
W, [2017-08-07T23:08:33.799837 #24841] WARN -- : gitlab-shell: Attempt to execute disallowed command <git receive-pack 'user/pruProgram.git'> by user with key key-1.
W, [2017-08-07T23:09:22.509888 #25006] WARN -- : gitlab-shell: Attempt to execute disallowed command <git receive-pack 'user/pruProgram.git'> by user with key key-1.
W, [2017-08-07T23:13:57.921136 #25626] WARN -- : gitlab-shell: Attempt to execute disallowed command <git receive-pack 'user/pruProgram.git'> by user with key key-1.
W, [2017-08-07T23:19:01.909144 #26864] WARN -- : gitlab-shell: Attempt to execute disallowed command <git upload-pack 'user/pruProgram.git'> by user with key key-1.
W, [2017-08-07T23:22:22.732120 #27344] WARN -- : gitlab-shell: Attempt to execute disallowed command <git upload-pack 'user/pruProgram.git'> by user with key key-1.
I, [2017-08-07T23:44:11.110398 #30251] INFO -- : Adding key key-2 => "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDITEDPYSbseUrbFW3Ii5dcKi6g4BJXi0U3yiK81NwXGcXGHMJCjlHNhblssetztc3xLuugK7syG+Sapt3kDvGzcOTi3NFrpYpv5y7RPlNVMBsgC+hSdsX3u6TZMuoSAByfgNK+DEkSGkgelrp6XIUWR4C4urLcxDqK7TFMM3xYF0JiE7t3lLRR7T8o+UY8gXozrmHyZout1CHpNv3OY9JDdj7V6+KjKAuVplJaqsx9zAh5sF7aGCUHUM5DESriLUjqgEgc+tZ4s31PPdgnhkX0Scm8M2405vnwLqIJ2a3qmpAwvOcM/rC/LTOJg4k7tjDtCEOr7v5usBNZwsUeiuuD"
W, [2017-08-07T23:48:40.016559 #30875] WARN -- : gitlab-shell: Attempt to execute disallowed command <git upload-pack 'user/pru6c.git'> by user with key key-1.
W, [2017-08-08T09:02:52.468088 #3630] WARN -- : gitlab-shell: Attempt to execute disallowed command <git upload-pack 'user/pru6c.git'> by user with key key-1.
I, [2017-08-08T09:04:31.179381 #3828] INFO -- : Removing key key-2
I, [2017-08-08T09:04:36.470186 #3852] INFO -- : Removing key key-1
I, [2017-08-08T09:05:17.803599 #3942] INFO -- : Adding key key-3 => "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDRFtPPqEGtCrgUHD+Q/WJcNKxOGm3h+paLQM9TOoDBQLG4HBb9cHoMPLEcX2USNy2TYaOIRQ8eCNu1O+E2u5RZWjG3rC35ygq5qu7LZH6Eed6vOGp5runWtyGsua3AQlJvu0FK247QeQaKnAmF77CqISW2ul0VDOp+Jw7KtfEf6r0smkkNEG7OpK5Cgjx7MZMNEN1Qsp8AzphcbLOTFNLR4oy+yMDUdtG9WDZEZKJmhpt0VeG1WAVHpxanLwza3fNG/Kwb2s6NolDD6CQAWaqM63wYh3HbU2m/S6kcLaAs1WDE0VIiVfIjoEMhnYVrcMKS6qAWYbjgJ7N5Dvq3JCXr"
По какой-то причине мои попытки получить доступ к репо после удаления и замены исходного ключа (удалили ключ-1 и заново ввели его как ключ-3) больше не вызывают сообщений журнала в gitlab-shell.log.
Когда я делаю "ssh -Tv git @ elm-ub1404, я получаю следующее:
OpenSSH_7.5p1, OpenSSL 1.0.2k 26 Jan 2017
debug1: Reading configuration data /home/user/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to elm-ub1404 [192.168.55.230] port 22.
debug1: Connection established.
debug1: identity file /home/user/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/user/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.5
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.8 pat OpenSSH_6.6.1* compat 0x04000000
debug1: Authenticating to elm-ub1404:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:p7T0NBYGy8Jwuv1OH3bIvuykgiqypAxfUXoVtqQoh8Q
debug1: Host 'elm-ub1404' is known and matches the ECDSA host key.
debug1: Found key in /home/user/.ssh/known_hosts:23
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/user/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentication succeeded (publickey).
Authenticated to elm-ub1404 ([192.168.55.230]:22).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: exec
debug1: Remote: Forced command.
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: Remote: Forced command.
debug1: Remote: Port forwarding disabled.
debug1: Remote: X11 forwarding disabled.
debug1: Remote: Agent forwarding disabled.
debug1: Remote: Pty allocation disabled.
debug1: No xauth program.
Warning: No xauth data; using fake authentication data for X11 forwarding.
debug1: Requesting X11 forwarding with authentication spoofing.
debug1: Remote: X11 forwarding disabled in user configuration file.
X11 forwarding request failed on channel 0
Welcome to GitLab, Bob Duffy!
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 2800, received 3080 bytes, in 2.3 seconds
Bytes per second: sent 1219.8, received 1341.7
debug1: Exit status 0
Итак, мои вопросы:
- Как я могу получить больше информации о соединении git-ssh?
- Как мне восстановить ssh доступ к GitLab?
ОБНОВИТЬ:
Просто чтобы быть уверенным, я копирую ссылки на репо со страницы проекта GitLab:
Elm-10:~/gitlabTest$ git clone git@elm-ub1404:rlduffy/program.git
Cloning into 'program'...
Warning: No xauth data; using fake authentication data for X11 forwarding.
X11 forwarding request failed on channel 0
GitLab: Disallowed command
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Elm-10:~/gitlabTest$ git clone http://elm-ub1404/rlduffy/program.git
Cloning into 'program'...
remote: Counting objects: 4760, done.
remote: Compressing objects: 100% (24/24), done.
remote: Total 4760 (delta 8), reused 0 (delta 0)
Receiving objects: 100% (4760/4760), 3.09 MiB | 19.54 MiB/s, done.
Resolving deltas: 100% (3542/3542), done.