Since a couple of days ago, I'm configuring GIT on a Linux server using GitLab (which was already pre-installed).
I have created a new project, and if I connect via HTTP I do not have any problems. I do it to the following address: link
However, when I try to connect via SSH to the following address: ssh: //[email protected]: 10022 / git / Probando.git jumps an error message that goes like this:
Incorrect credentials for repository at ssh: //192.168.1.33: 10022 / git / Probando.git
I think the problem is with the SSH Keys. I have created a key and I have inserted it, but it seems that it does not work. I describe how I created and inserted it:
Initialize the repository:
git init
I access the following route
cd ~/.ssh
I generate the new password using the email [email protected]
ssh-keygen -t rsa -C '[email protected]'
When he tells me to enter the name of a file, I type git_rsa
When he says Enter passphrase I leave it blank (pulse enter)
[~/.ssh] # ssh-keygen -t rsa -C '[email protected]'
Generating public/private rsa key pair.
Enter file in which to save the key (/share/homes/admin/.ssh/id_rsa): git_rsa
git_rsa already exists.
Overwrite (y/n)? y
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in git_rsa.
Your public key has been saved in git_rsa.pub.
The key fingerprint is:
SHA256:uiwCccsRLRC7IrTmRufRKi4O0LGsx7L8lcBqt1bOaX4 [email protected]
The key's randomart image is:
+---[RSA 2048]----+
|oo . |
| .o . |
|...o |
|o+=o. |
|=B+B . S |
|Oo* +... |
|+Bo++oo |
|B++.+* E |
|++o+oo+ |
+----[SHA256]-----+
Now I print the generated key and copy it:
cat git_rsa.pub
It's something like that (I delete a piece for security):
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC12zoBWILH38qY+hSLgPUwEChh2BdH9C/ydHP/EBBzm5nAJGRB.....................6IlE2RI4c/4iF1995oONG85yzy6sVEKe/qgRM0CGwrRNT00/491JjmdjZwvzVlii+5wdd4BUvHbn/N5Somt1XBVFtsPzhIetHgXKB [email protected]
I go to GitLab and open the SSH Keys tab
- Pulse in ADD SSH KEY
- I paste the copied key
- I keep the changes
- It is assumed that the key is already inserted ....
But when I go in, I enter the SSH address, username and password (the same credentials that the HTTP connection works correctly for) and it tells me that the credentials are incorrect.
Any ideas of what may be happening?