GitLab ssh Benutzerzugriffsrechte

693
rlduffy

Ich habe eine Version von GitLab, die ich im letzten Herbst installiert habe. Leider kann ich keine Versionsnummer ermitteln. Es wird auf Ubuntu 1404 in einer VM auf einem Win10-Host gehostet. UPDATE: Sieht aus wie Version 9.4.3-ce.0 und ist die neueste Version, die von den Ubuntu-Paketservern verfügbar ist.

Ich erholte mich von einer Katastrophe, die eine kalte Neuinstallation von Win10 erforderlich machte. Ich habe die VM in VirtualBox installiert. Meine GitLab-Anmeldeinformationen scheinen einwandfrei zu funktionieren. Ich kann mich beim Server anmelden und meine Projekte mit http klonen. Was ich nicht tun kann, ist über SSH auf den Server zuzugreifen. Ich sollte hinzufügen, dass vor der Katastrophe alles gut funktioniert hat.

Von msys bash aus kann ich ssh einfach in die VM einbinden, aber alle Versuche, über ssh auf GitLab zuzugreifen, bewirken Folgendes:

$ 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. 

Ich habe bestätigt, dass der Schlüssel in GitLabs Settings / ssh-keys der richtige ist. Ich habe es sogar gelöscht und dann wieder hinzugefügt, ohne Erfolg.

Die Protokolldatei gitlab-shell.log enthält Folgendes:

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" 

Aus irgendeinem Grund lösen meine Versuche, nach dem Löschen und Ersetzen des Originalschlüssels (gelöschter Schlüssel-1 und erneutes Eingeben als Schlüssel-3) auf das Repo zuzugreifen, keine Protokollnachrichten mehr in gitlab-shell.log aus.

Wenn ich "ssh -Tv git @ elm-ub1404" mache, erhalte ich Folgendes:

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 

Meine Fragen sind also:

  1. Wie bekomme ich weitere Informationen zur git-ssh-Verbindung?
  2. Wie erhalte ich ssh wieder Zugriff auf GitLab?

AKTUALISIEREN:

Zur Sicherheit kopiere ich die Repo-Referenzen von der GitLab-Projektseite:

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. 
0
Die erste Nachricht enthält keine Informationen zum SSH-Zugriff, sondern zur tatsächlichen Existenz des Repositorys. Wo wurde es gehostet? Im VM-Speicher oder in einem freigegebenen Windows-Verzeichnis? xenoid vor 6 Jahren 0
Das Repo wird in der VM gespeichert. Ich kann unter Windows mit git über http darauf zugreifen und das Web-Interface verwenden. Es schlägt jedoch fehl, ssh zu verwenden. rlduffy vor 6 Jahren 0
Ihre angegebene Remote-Adresse stimmt nicht, es sollte "git @ host: / path / to.git" sein - "git @ elm-ub1404: / xxx / program.git" Zumindest vermissen Sie Doppelpunkte vor 6 Jahren 0

1 Antwort auf die Frage

0
rlduffy

Ich vermute, dass sich das Problem durch die Deinstallation und Neuinstallation von GitLab lösen würde, aber ich bin nicht bereit, das gerade jetzt zu tun, also greife ich stattdessen auf http zurück.