updated: 2016-01-21

Almost every Git Repo service (like Github, Bitbucket, GitLab, etc. ) supports SSH while doing git commands through CLI. Besides security, another biggest benefit of using SSH is to save the time for username and password.

However, if your machine is not set up correctly, you may encounter this issue.

Git SSH Error

Here is how to do a “easy-fix”.

Basically, it is because the remote Git Repo server could not authenticate you with any of the keys that are stored in your local machine.

If you run ssh -Tv git@gitrepo.org, it will list the details on how the process is checking each SSH key pair. From this list, you will find out that – it ONLY check the pair with the name id_rsa. If you have any one with a customized name, it will load any more~~~

So, to fix it, simply copy the right public SSH key by pbcopy < ~/.ssh/id_rsa.pub and add it to Git Repo server. Then you should be ready to go this time.

If needed, you may delete the “related” entries (the domain and IP of the Git Repo sever) from the file ~/.ssh/known_hosts.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>