Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
512 views
in Technique[技术] by (71.8m points)

Can't authenticate via ssh key on new GitLab container

I've recently set up a new GitLab docker container, and though everything else has been working great I can't authenticate to it via ssh.

I followed the instructions here to the letter, with no succes. Whatever key type I generate, and regardless of the client (Linux, Windows git-bash), The server instantly rejects the publickey and does not prompt for a password.

Debug shows the following:

debug1: Offering public key: /c/Users/[user]/.ssh/id_ed25519 ED25519   SHA256:[SHA-256]
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51

Maybe it's something obvious, but I can't quite figure it out and no troubleshooting step managed to help. As a side note, the ssh port is non standard, though I am accesing via the new port. I've also double checked ssh is enabled on both the server and the clients.

Any help would be greatly appreciated.

Thanks!

question from:https://stackoverflow.com/questions/65951624/cant-authenticate-via-ssh-key-on-new-gitlab-container

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Check first if this is similar to gitlab-org/gitlab-foss issue 18371 "docker omnibus gitlab denying ssh public key"

In my case the problem was mismatch between ssh socket that docker container was exposing and my server's one.
It helped to expose it on different port like 10022 and reconfiguring gitlab like this:

gitlab_rails['gitlab_shell_ssh_port'] = 10022

Ideally, you would need to stop, restart the ssh daemon (server side, container side as seen in this thread) with

usr/sbin/sshd -d

That would allow you to check:

  • if the SSH request is received at all
  • if it is blocked for any reason

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...