Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github ssh key added, checked, still doesn't work

I created ssh key as per this tutorial.

Assigned it to the ssh-agent.

Added it to the github account as per this tutorial.

ssh-add -l -E md5

Shows correct footprint

ssh -T [email protected]

Says:

Hi <My username>! You've successfully authenticated, but GitHub does not provide shell access.

But still:

git push

Asks for:

Username for 'https://github.com':

Any idea? Thanks in advance.

like image 947
Mahdiyeh Avatar asked Mar 26 '18 17:03

Mahdiyeh


People also ask

Why are my SSH keys not working?

Make sure the authorized_keys file and the private key itself have the correct permissions and ownership. Check that key-based authentication is allowed by the server. Make sure the private key is readable by the SSH client. If you're using PuTTY, make sure your SSH keys are properly configured for the session.

How do I fix my SSH key in GitHub?

In terminal enter this command with your ssh file name pbcopy < ~/. ssh/id_rsa. pub This will copy the file to your clipboard Now open you github account Go to Settings > SSH and GPG keys > New SSH key Enter title and paste the key from clipboard and save it. Voila you're done.


1 Answers

Check out this: switching-remote-urls-from-https-to-ssh

High are the changes that you clone your repo over HTTPS and now want to push using SSH.

As suggested on the GitHub site check your remote origin by doing this:

$ git remote -v
origin  https://github.com/USERNAME/REPOSITORY.git (fetch)
origin  https://github.com/USERNAME/REPOSITORY.git (push)

In case you have https... change it to ssh by doing something like this:

git remote set-url origin [email protected]:USERNAME/REPOSITORY.git
like image 102
nbari Avatar answered Sep 21 '22 16:09

nbari