3

I am trying to clone a repo from github. To do that

  1. I have generated a ssh key using: ssh-keygen.

  2. Then I added the content of ~/.ssh/id_rsa.pub to my keys in github account.

Even after that I am unable to clone any repo. I am getting following error:

ssh_exchange_identification: read: Operation timed out
Please make sure you have the correct access rights
and the repository exists.

In this regard, I have gone through a few posts here, but unable to fix.

NOTE: This error I am facing even after removing SSH key from my github account.

EDIT: When I am doing "ssh -T [email protected]", I am getting the same error:

ssh_exchange_identification: read: Operation timed out

As suggested in: https://help.github.com/en/articles/error-permission-denied-publickey, while executing following commands:

 1. ssh-add -l ==> The agent has no identities.
 2. ssh-add -l -E md5 ==> The agent has no identities.

4 Answers 4

1

You get this error for one of these 3 reasons:

  1. when you have authentication/authorization problems
  2. When you have an internet access problem
  3. SSh problems

Do the following:

first in your terminal run ssh -T [email protected] if you see your GitHub username in response. you know that you are authenticated properly if not...

first check internet access: make sure you can access GitHub by cloning a public repo (any repo) by SSH (not https). if you fail here you have problems with SSH or internet connection

if this step passed, try to clone one of your other private repos by ssh. if you failed. you have an authentication problem and your ssh key is wrong. (try again by https and compare the results)

if this step passed, try to clone this repo by https (not ssh). if you failed. you have an authorization problem and you have no access to this repo

Sign up to request clarification or add additional context in comments.

7 Comments

Internet is fine, as I am able to clone the same repo with https
what is result of running this command inside terminal? ssh -T [email protected]
So have SSH problems... Are you sure SSH port is not closed by a firewall? or your internet provider?
Yeah I am not getting idea regarding how to fix it ? I have added/deleted ssh keys in my github multiple times.
You don't have ssh-key problem (at least so far!) you have SSH problem regardless of keys! find a free ssh server and try to connect them. If you don't have any, you can find here: shells.red-pill.eu. this is not a github related issues. this is a SSH related issue. you mis-changed ssh config or your network banned ssh packets
|
1

One of the solutions that worked for me was setting ssh config.

  1. Create and open config file: sudo nano ~/.ssh/config

  2. Add following lines and save:

Host github.com
Hostname ssh.github.com
Port 443
  1. Try running: ssh -T [email protected]

Now you can clone the repo.

Comments

0

I was facing the same issue on a deivce i hadn't used for a while. Command ssh -T [email protected] returned: "no such identity: C:\Users\sfolk/.ssh/id_ed25519_github-account-name-here No such file or directory"

I did create new keys however; which created the file "id_ed25119"

So to solve this, i renamed the anonymous fie, added "_github-account-name-here. It uses the same SSH key

Comments

0

To check what keys ssh is attempting to use run ssh -vT [email protected]. That showed the key I was attempting to use wasn't actually being used by SSH, despite being in my home SSH folder.

To ensure ssh saw the key I added the line IdentityFile ~/.ssh/<my_private_key> to /etc/ssh/ssh_config (or wherever your global config is).

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.