Ssh -vT git@github.com" errors: "kex_exchange_identification: Connection closed by remote host

I am having trouble configuring my SSH key. I have generated a new SSH key and added it to my GitHub account, but it is not working. I have attempted several solutions, but still cannot fix it.

The output from the command ssh -vT git@github.com is as follows:

OpenSSH_8.1p1, OpenSSL 1.1.1d  10 Sep 2019
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to github.com [111.40.234.2] port 22.
debug1: Connection established.
debug1: identity file /c/Users/dell/.ssh/id_rsa type 0
debug1: identity file /c/Users/dell/.ssh/id_rsa-cert type -1
debug1: identity file /c/Users/dell/.ssh/id_dsa type -1
debug1: identity file /c/Users/dell/.ssh/id_dsa-cert type -1
debug1: identity file /c/Users/dell/.ssh/id_ecdsa type -1
debug1: identity file /c/Users/dell/.ssh/id_ecdsa-cert type -1
debug1: identity file /c/Users/dell/.ssh/id_ed25519 type -1
debug1: identity file /c/Users/dell/.ssh/id_ed25519-cert type -1
debug1: identity file /c/Users/dell/.ssh/id_xmss type -1
debug1: identity file /c/Users/dell/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.1
kex_exchange_identification: Connection closed by remote host

What can I do to resolve this issue?

It appears that there may be an issue with the SSH connection to GitHub. One possible solution is to check the SSH key permissions and ensure that the private key is not publicly accessible. Another solution is to try using HTTPS instead of SSH for Git operations. To do this, you can change the remote URL for the Git repository to use HTTPS instead of SSH. You can do this by running the following command in your local Git repository:

git remote set-url origin https://github.com/USERNAME/REPOSITORY.git

Replace “USERNAME” with your GitHub username and “REPOSITORY” with the name of your Git repository.