SSH Key Continues to Request Password in Gitlab

I debug the problem for an hour or two.

I am currently using Gitlab and Mac OS X 10.9.2.

Today I tried git pull origin master from our main branch so that I could develop the latest version. I always used these configurations and I don’t remember changing anything. This configuration always worked and never asked me for a password. Today I got this error:

My-MacBook-Pro: loop_name loop $ git main pull source

git @domain password:

Here are my permissions ~/.ssh/ :

 My-MacBook-Pro:.ssh loop$ ls -l total 24 -rw------- 1 loop staff 1766 Oct 31 2013 github_rsa -rw-r--r-- 1 loop staff 403 Oct 31 2013 github_rsa.pub -rw-r--r-- 1 loop staff 2408 Sep 15 15:08 known_hosts 

I tried different things:

  • reboot com.openssh.sshd

  • restart org.openbsd.ssh-agent

  • I made sure that my public key in Gitlab is the same as my github_rsa.pub , and it really was the same.

  • I uncommented sshd_config to PasswordAuthentication no

  • Checked /var/log/authd.log for errors related to SSH, but nothing is relevant.

What could be the problem?

+5
source share
2 answers

Rename the github_rsa file to id_rsa.

SSH looks for a private key named "id_rsa" in the .ssh folder of your home.

Could not find it now because you renamed it.

PS: Whenever you encounter a problem in SSH, try running it with the -vvv option to get detailed output!

Hope this solves the problem!

Happy Gitting!

+3
source

This is fixed by creating a new public / private key only for Gitlab without a password.

Create a new SSH key:

ssh-keygen -t rsa -C " name@domain.com "

Note. In this case, when I was asked to enter a password, I left it blank, since this key is used only for internal use.

Reset Content:

cat ~ / .ssh / id_rsa.pub

Finally, copy the content to add it to Gitlab.

+1
source

Source: https://habr.com/ru/post/1203382/


All Articles