4

the way I config the ssh-key, I generate a new ssh key, add to my github,but something is wrong, I try many ways,but I can not.

$ ssh -vT git@github.com
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?

aptx1231
  • 49
  • 1
  • 3
  • 1
    You seem to be using Windows and Cygwin. These details should probably be mentioned in your question. Also, how is your `ssh` client configured, and how specifically are you tel\ing it which key to use for Github? – tripleee Jan 11 '20 at 14:47

2 Answers2

1

I suspect there're too many keys in your ~/.ssh/. Point ssh to the exact key you use. In ~/.ssh/config:

Host github.com
    User git
    HostName github.com
    IdentityFile ~/.ssh/id_rsa # or whatever key you use with Github

Then try ssh -Tv git@github.com again.

phd
  • 69,888
  • 11
  • 97
  • 133
1

If you have only one key, try and regenerate it with the old PEM format, and no passphrase, for testing:

ssh-keygen -t rsa -P "" -m PEM

Copy the content of id_rsa.pub to your GitHub profile, and try again.

VonC
  • 1,129,465
  • 480
  • 4,036
  • 4,755