Не могу подключиться к GitLab через ssh - PullRequest
1 голос
/ 27 января 2020

Сначала я создал пару ключей s sh с помощью команды:

ssh-keygen -o -t rsa -b 4096 -C "email@example.com"

Затем я добавил содержимое файла id_rsa.pub в свой профиль GitLab. Но когда я попытался проверить, правильно ли был добавлен мой ключ S SH:

ssh -vvvT user@some.gitlab.com

, после ввода правильного пароля я получил следующий журнал:

debug3: send packet: type 61
debug3: receive packet: type 60
debug2: input_userauth_info_req
debug2: input_userauth_info_req: num_prompts 0
debug3: send packet: type 61
debug3: receive packet: type 52
debug1: Authentication succeeded (keyboard-interactive).
Authenticated to some.gitlab.com ([xxx.xxx.xxx.xxx]:xx).
debug1: channel 0: new [client-session]
debug3: ssh_session2_open: channel_new: 0
debug2: channel 0: send open
debug3: send packet: type 90
debug1: Requesting no-more-sessions@openssh.com
debug3: send packet: type 80
debug1: Entering interactive session.
debug1: pledge: network
debug3: receive packet: type 80
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug3: receive packet: type 91
debug2: channel_input_open_confirmation: channel 0: callback start
debug2: fd 3 setting TCP_NODELAY
debug2: client_session2_setup: id 0
debug2: channel 0: request shell confirm 1
debug3: send packet: type 98
debug2: channel_input_open_confirmation: channel 0: callback done
debug2: channel 0: open confirm rwindow 0 rmax 32768
debug2: channel 0: rcvd adjust 2097152
debug3: receive packet: type 99
debug2: channel_input_status_confirm: type 99 id 0
debug2: shell request accepted on channel 0
Last failed login: Sun Jan 26 21:33:13 UTC 2020 from some-freeipa.com on ssh:notty

И ничего остальное. Печать журнала остановлена, а консоль заморожена. Также я пытался клонировать некоторые проекты из моего GitLab с помощью команды:

git clone ssh://user@some-gitlab-url/some-project.git

Но у меня есть ошибка:

Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Может кто-нибудь, пожалуйста, помогите мне с вопрос

1 Ответ

2 голосов
/ 27 января 2020
shell request accepted on channel 0

Это означает, что, возможно, часть s sh работает.

Что не будет работать, так это URL, используемый для клонирования репо:

  • пользователи должно быть git (всегда в обычной установке GitLab)
  • URL должен включать пользователя / группу и репозиторий

Так что не s sh: // user@some-gitlab-url/some-project.git но

ssh://git@some-gitlab-url/some-group/some-project.git

Как было обнаружено оператором в чате , проблема была в используемой библиотеке S SH .

Проблема была с клиентом OpenS SH.
Во время обсуждения я использовал клиент OpenS SH для Windows.
После того, как он был изменен на Git Bash, он запустился. для работы!

Я упоминается здесь , что Windows 10 (1809+) добавляет OpenS SH Клиент (и сервер).
Но Git для Windows поставляется с OpenS SH 8.1 .

, поскольку Windows S SH является вилкой (PowerShell/openssh-portable) из openS SH один, с использованием одного из Git безопаснее.

* 104 3 * В более общем случае, используя Git с путем , начиная с с:
set GH=C:\path\to\git
set PATH=%GH%\bin;%GH%\usr\bin;%GH%\cmd;%GH%\mingw64\bin;%PATH%

Это обеспечит использование сначала Git с его зависимостями времени выполнения (а затем Windows ).

...