Search code examples
gitgithubsshssh-keys

GitHub error - "ssh_exchange_identification: read: Connection reset by peer"


I just generated ssh keys in my Git Bash for an app I want to push to GitHub. I added the agent and agent identity, copied the key and created a new SSH Key in my GitHub account. When I try to run $ssh -T github@github.com I get an error message that says "ssh_exchange_identification: read: Connection reset by peer". I have seen this questioned posed before but not directly in relation to GitHub (correct me if I am wrong). I see my id_ras and id_rsa.pub files in my User\.ssh folder. What could be the problem causing this error message? Note: I am running this inside my office and wonder if this could be caused by the office network firewall?


Solution

  • First ssh -T github@github.com would not work
    ssh -T git@github.com would

    Second, if you have any proxy/firewall in your office, outgoing ssh connection should be blocked.
    Using an https URL (with credential caching) is your best option.