navyblueyes
navyblueyes

Reputation: 47

GitHub SSH troubles.... added the key... still doesn't work

Steps I did so far...

  1. sudo ssh-keygen -t rsa -b 4096 -C "[email protected]"
  1. ssh-add ~/.ssh/id_rsa
  1. cat /home/mink/.ssh/id_rsa.pub
  1. then I follow the Github instructions...
git init
git add README.md
git commit -m "first commit"
  1. I get greeted with this message...
*** Please tell me who you are.

Run

  git config --global user.email "[email protected]"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.
  1. So I configure the user details [I thought I didn't need to do this because of the key setup????] And i continue with GitHub instructions
git remote add origin [email protected]:navyblueyes/template-test.git
git push -u origin master
  1. Right after the push... I get greeted with this...
mink@DESKTOP-ALARD0U:/mnt/c/Users/Micha/.LocalCode/js-exercises/--templat$ git push -u origin master
ssh: Could not resolve hostname github.com: Temporary failure in name resolution
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

What am I missing?

Upvotes: 1

Views: 523

Answers (1)

VonC
VonC

Reputation: 1324268

So I configure the user details [I thought I didn't need to do this because of the key setup????]

This (user.name/user.email) has nothing to do with remote repository hosting service authentication (which is why the SSH key is used for).
It is for local commits authorship.

Second, ping github.com: if it fails, that would mean a DNS resolution error.
If not, try, for testing, accessing the repository using HTTPS

git ls-remote https://github.com/navyblueyes/template-test.git 

Try the same using SSH:

git -c 'core.sshCommand="ssh -v"' ls-remote https://github.com/navyblueyes/template-test.git

That last command will show you if your key is actually used.

Upvotes: 1

Related Questions