먼저 다음 명령으로 ssh 키 쌍을 만들었습니다.
ssh-keygen -o -t rsa -b 4096 -C "[email protected]"
그런 다음 id_rsa.pub 파일의 내용을 GitLab 프로필에 추가했습니다. 그러나 SSH 키가 올바르게 추가되었는지 테스트하려고 할 때 :
ssh -vvvT [email protected]
올바른 암호를 입력 한 후 다음 로그가 있습니다.
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 [email protected]
debug3: send packet: type 80
debug1: Entering interactive session.
debug1: pledge: network
debug3: receive packet: type 80
debug1: client_input_global_request: rtype [email protected] 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.
누구든지 제발 문제를 도와 줄 수 있습니까?
shell request accepted on channel 0
이는 아마도 ssh 부분이 작동하고 있음을 의미합니다.
작동하지 않는 것은 저장소를 복제하는 데 사용되는 URL입니다.
그래서 ssh : //user@some-gitlab-url/some-project.git이 아니라
ssh://git@some-gitlab-url/some-group/some-project.git
발견 채팅에서 OP에 의해 , 문제는 사용 된 SSH 라이브러리이었다 .
문제는 OpenSSH 클라이언트에있었습니다.
토론하는 동안 저는 Windows 용 OpenSSH 클라이언트를 사용하고있었습니다.
Git Bash로 변경된 후 작동하기 시작했습니다!
나는 여기에 언급 윈도우 10 (1809+)의 추가하는 OpenSSH를 클라이언트 (및 서버).
그러나 Windows 용 Git 에는 OpenSSH 8.1 이 함께 제공됩니다 .
Windows SSH는 PowerShell/openssh-portable
openSSH 의 포크 ( )이므로 Git의 SSH를 사용하는 것이 더 안전합니다.
일반적으로 다음으로 시작 하는 경로로 Git을 사용합니다 .
set GH=C:\path\to\git
set PATH=%GH%\bin;%GH%\usr\bin;%GH%\cmd;%GH%\mingw64\bin;%PATH%
그러면 먼저 런타임 종속성과 함께 Git을 사용하고 Windows를 차례로 사용할 수 있습니다.
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다