I have been debugging the issue for an hour or two now.
I am currently using Gitlab and Mac OS X 10.9.2.
Today, I was trying to git pull origin master
from our master branch so I can get the latest version to develop on. I have always used these configurations, and don't recall changing anything. This configuration has always worked, and never prompted me for a password. Today, I got this error:
My-MacBook-Pro:branch_name loop$ git pull origin master
git@domain's password:
Here are my ~/.ssh/
permissions:
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 have tried various things:
restarting com.openssh.sshd
restarting org.openbsd.ssh-agent
I made sure that my public key on Gitlab is the same as my github_rsa.pub
, and it indeed was the same.
I have uncommented sshd_config
's to PasswordAuthentication no
Checked /var/log/authd.log
for errors relating to SSH, but nothing relevant.
What could be the issue?
You can avoid being prompted for your password by configuring Git to cache your credentials for you. Once you've configured credential caching, Git automatically uses your cached personal access token when you pull or push a repository using HTTPS.
SSH passphrases protect your private key from being used by someone who doesn't know the passphrase. Without a passphrase, anyone who gains access to your computer has the potential to copy your private key.
Why Git Keeps Prompting you for Username and Password. Using HTTPS remote URL is useful if you need to work through strict firewalls and proxies but this also means that you'll get prompted for your GitHub username and password each time you pull or push your code to your repository.
Rename the file github_rsa to id_rsa.
SSH looks for the private key by "name" id_rsa in .ssh folder of your home.
Its not able to find it now because you have renamed it.
PS: Whenever you encounter a problem in SSH try running it with option -vvv
so that you get a verbose output!
Hope this solves the problem!
Happy Gitting!
Fixed this by generating a new public/private key just for Gitlab with no password.
Create a new SSH key:
ssh-keygen -t rsa -C "[email protected]"
Note: For this scenario, when it prompted me to enter a password, I left it blank, since this key is simply for internal use.
Dump the contents:
cat ~/.ssh/id_rsa.pub
Finally, copy the contents to add to Gitlab.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With