简体   繁体   English

在Windows 7机器上设置github ssh

[英]setting up github ssh on windows 7 machine

I just installed git on my windows machine using git's how to guide , but I am having a problem. 我刚刚使用git如何引导我的Windows机器上安装了git,但是我遇到了问题。

When I run ssh -T git@github.com step I am getting this error: 当我运行ssh -T git@github.com步骤时,我收到此错误:

ssh_exchange_identification: read: Connection reset by peer ssh_exchange_identification:读取:由对等方重置连接

here is a longer trace that I got by running ssh -vvv git@github.com : 这是我通过运行ssh -vvv git@github.com获得的更长的跟踪:

OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug2: ssh_connect: needpriv 0
debug1: Connecting to github.com [207.97.227.239] port 22.
debug1: Connection established.
debug1: identity file /c/Users/bmehanni/.ssh/identity type -1
debug3: Not a RSA1 key file /c/Users/bmehanni/.ssh/id_rsa.
debug2: key_type_from_name: unknown key type '-----BEGIN'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'Proc-Type:'
debug3: key_read: missing keytype
debug2: key_type_from_name: unknown key type 'DEK-Info:'
debug3: key_read: missing keytype
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug3: key_read: missing whitespace
debug2: key_type_from_name: unknown key type '-----END'
debug3: key_read: missing keytype
debug1: identity file /c/Users/bmehanni/.ssh/id_rsa type 1
debug1: identity file /c/Users/bmehanni/.ssh/id_dsa type -1
ssh_exchange_identification: read: Connection reset by peer

Thanks 谢谢

I had the same problem, but never found a way to solve it. 我有同样的问题,但从未找到解决问题的方法。

The workaround was to use https instead of ssh. 解决方法是使用https而不是ssh。

It seems like the type of your id_rsa key is wrong 看起来你的id_rsa键的类型是错误的

debug2: key_type_from_name: unknown key type

ssh is trying to infer the type from the key file name. ssh试图从密钥文件名中推断出类型。 When you generate the key, you need to specify the type with -t rsa flag. 生成密钥时,需要使用-t rsa标志指定类型。

ssh-keygen -t rsa

Also, accept the default values for the file name of your private key id_rsa and your public key id_rsa.pub , otherwise you would need to add a configuration for github in ~/.ssh/config file specifying the private key to use for that specific host. 另外,接受私钥id_rsa和公钥id_rsa.pub的文件名的默认值,否则你需要在~/.ssh/config文件中添加github的配置,指定用于该特定的私钥。主办。

Host github.com
    HostName github.com
    User git
    IdentityFile C:/Users/youruser/.ssh/someotherkeyname

It looks like there's something wrong with your ssh key, so I'm guessing something went wrong while you were running ssh-keygen. 看起来你的ssh密钥有问题,所以我猜你在运行ssh-keygen时出了什么问题。 Try re-running that step 尝试重新运行该步骤

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM