Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

password required for user git on host github.com?

Erica Heinz November 26, 2016

I've migrated to a new Mac, and SourceTree won't let me pull or push. It says "Password Required For user git on host github.com", but neither my Github or Atlassian passwords are accepted. I tried generating a new SSH key and uploading it to my github account, but that didn't work either. Any insight would be much appreciated!

4 answers

1 accepted

2 votes
Answer accepted
Erica Heinz November 28, 2016

Update: I still have no idea what I'm doing, but adding this config file fixed the problem:

http://stackoverflow.com/questions/9960897/why-doesnt-my-ssh-key-work-for-connecting-to-github

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 28, 2016

I've never had to mess with that file, but I couldn't tell you why. Glad you found a solution!

DonnaLea
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 1, 2017

This is along the lines of what worked for me too. However, I found the answer on github and that calmed my nerves for changing random config files. Apparently it's something for macOS Sierra 10.12.2 or later.

https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/#adding-your-ssh-key-to-the-ssh-agent

Greg Burdett
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 11, 2018

@DonnaLea Thanks, that page worked for me! I had the issue after upgrading from MacOS EL Capitan to High Sierra. 

3 votes
karwalbubble
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 6, 2018

Resolved it by using same passphrase as password when prompted that I used to connect bitbucket/git account in SourceTree.

Francisco Santana
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 7, 2019

This worked for me!

2 votes
Bashu Naimi-Roy
Contributor
February 14, 2021

I was experiencing the same error on MacOS Big Sur, after trying to clone a repo using SSH. Github provided a URL beginning with git@github.com, I'd paste this into Sourcetree and receive the prompt "password required for user git on host github.com". 

I connected my Github account to Sourcetree using OAuth, so there was no "password" that I could use (as far as I knew)

I found this marvelous comment from DiscDev

Basically it recommends using 'ssh -T git@github.com'. I tried this in my terminal and received

the authenticity of host 'github.com (140.82.113.4)' can't be established.
RSA key fingerprint is (insert RSA fingerprint here).
Are you sure you want to continue connecting (yes/no/[fingerprint])?

Typed yes, received

Hi (my user name here)! You've successfully authenticated, but GitHub does not provide shell access.

tried to clone again in Sourcetree (after deleting my Sourcetree entries from Keychain Access) and it's cloning fine using SSH.

I'm not entirely sure why because neither my ~/.ssh/config file nor my Keychain have been edited after this "authentication". I assume there's something on the Github server side? I'm satisfied with the results and moving on to the original coding I wanted to do. If somebody tries it and learns more, I'd invite them to comment on my Answer to appease my curiosity.

Rafael91
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
February 15, 2021

I was struggling with this issue for some time - your solution works for me thanks!

2 votes
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 28, 2016

Your Atlassian password definitely won't work. GitHub is not an Atlassian product.

If you have 2-Factor Authentication enabled in GitHub, you can follow these instructions to use password authentication in SourceTree: https://confluence.atlassian.com/sourcetreekb/two-factor-authentication-2fa-with-github-in-sourcetree-402033499.html

We would need more information to debug the SSH issue, but you might try ideas from this post: http://stackoverflow.com/questions/20644173/unable-to-get-ssh-keys-working-between-sourcetree-and-github

Erica Heinz November 28, 2016

Thanks so much! I followed the 2FA instructions to generate the token, and went to SourceTree settings > Edit Account and pasted it there (following https://clburlison.com/github-two-factor-authentication/), but I'm still getting the password required dialog (which doesn't accept the token either). Not sure I understand.

I'd seen the other post, but the Mac app doesn't have the "Tools" menu described in the first answer, and the "correct repo path" in the second answer is how I have things set up already.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events