Answer the question
In order to leave comments, you need to log in
I can't connect to gitlab via SSH, why?
Good afternoon!
There is a gitlab deployed on its server, it works successfully, projects are uploaded, everything is created, the web interface also works.
Previously, it was not so often necessary to upload projects, since there were almost no edits, so when uploading to gitlab, they simply entered a username and password.
Now there is a need for frequent commits, and entering a username and password is often not very convenient.
I decided to set up authorization via SSH key.
For cleanliness, I deleted everything from the .ssh folder and did everything from scratch.
I do the following algorithm:
Answer the question
In order to leave comments, you need to log in
Thank you all for your help, every piece of advice has definitely helped.
The solution was, as always, on the surface.
The thing was that the sshd_config file on the server , which is located at the following path: /etc/ssh in the AllowUsers line contained only one available user, added a git user under which authorization takes place and everything began to work.
The line AllowUsers after making changes began to look like this: I
AllowUsers youruser git
describe the algorithm in more detail, in case someone encounters such a problem.
Host 45.80.69.169
IdentityFile /home/kramdmitriy/.ssh/id_rsa
port 22
Host gitlab.iso-team.ru
IdentityFile /home/kramdmitriy/.ssh/gitlab
port 22
Look, you have a machine running gitlab. And there is an ssh server on this machine. And you get into it. And you need to get into the ssh server of the gitlab itself, which knows about your git projects. The easiest way is to move the machine's ssh server to a non-standard port.
The system user and the gitlab user are two different users. Instruction
Run this command on the machine from which you plan to connect, under your account from under which you work on the same machine:
ssh-keygen -t rsa -f ~/.ssh/gitlab
Then copy the key to the server where the gitlab is deployed using the command:
ssh-copy-id -i ~/.ssh/gitlab.pub [email protected]
ssh [email protected]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question