gpt4 book ai didi

windows - 在 Windows 7 上配置 GitBash : ssh failing, 我正在尝试一切,发疯了

转载 作者:可可西里 更新时间:2023-11-01 10:46:50 25 4
gpt4 key购买 nike

我快要疯了,只是想通过 ssh 连接到 github。

我在 Windows 7 上。

对 Murgatroyd 说实话,我整天都在搜索谷歌和论坛,但没有突破。

在我最近的尝试中,我在 C:\Users\myname.ssh 中放置了一个配置文件。结果更接近幸福,但仍未达到。

我的配置简单地说:

Host github.com
IdentityFile ~/.ssh/id_rsa

命令 ssh -vT git@github.com 产生:

OpenSSH_4.6p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Reading configuration data /c/Users/myname/.ssh/config
debug1: Applying options for github.com
debug1: Connecting to github.com [192.30.252.130] port 22.
debug1: Connection established.
debug1: identity file /c/Users/myname/.ssh/id_rsa type 1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.9p1 Debian-5ubuntu1+github5
debug1: match: OpenSSH_5.9p1 Debian-5ubuntu1+github5 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_4.6
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'github.com' is known and matches the RSA host key.
debug1: Found key in /c/Users/myname/.ssh/known_hosts:2
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: /c/Users/myname/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: No more authentication methods to try.
Permission denied (publickey).

输出的顶部看起来像是找到并使用了我的 key ,而底部好像没有。

我很困惑。

如有任何建议,我们将不胜感激。

感谢阅读。

最佳答案

正如我在“SSH error on push to an existing project Permission denied (publickey)”中提到的,仔细检查:

  • 您的 %HOME% 环境变量(应设置为 %USERPROFILE%)
  • %HOME%\.ssh\config 文件中的完整 (Windows) 路径('~' 对 Windows 意义不大)。
    例如:

    Host gitlab.com
    HostName gitlab.com
    IdentityFile C:\path\to\.ssh\gitlab_rsa
    IdentitiesOnly yes

请注意,如果您使用默认名称 id_rsaid_rsa.pub 作为私钥和公钥,则不需要配置文件。

关于windows - 在 Windows 7 上配置 GitBash : ssh failing, 我正在尝试一切,发疯了,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20790979/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com