gpt4 book ai didi

git - 为什么我不能在 Windows 7 上使用 Cygwin SSH 从 Github 克隆存储库?

转载 作者:太空狗 更新时间:2023-10-29 14:29:17 28 4
gpt4 key购买 nike

我想使用 Git+Cygwin+Ssh 从 Github 克隆我自己的存储库。

怎么做 - 我创建 key ,我在 github.com 上发布公钥,我做 ssh-add?

我做错了什么?

$git clone git@github.com:ChameleonRed/test.gitCloning into 'test'...Warning: Permanently added the RSA host key for IP address '192.30.252.123' to the list of known hosts.Permission denied (publickey).fatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.

记录更多细节:

OpenSSH_7.2p2, OpenSSL 1.0.2g  1 Mar 2016debug1: Reading configuration data /etc/ssh_configdebug1: Connecting to github.com [192.30.252.123] port 22.debug1: Connection established.debug1: identity file /home/Crezary Wagner/.ssh/id_rsa type 1debug1: key_load_public: No such file or directorydebug1: identity file /home/Crezary Wagner/.ssh/id_rsa-cert type -1debug1: key_load_public: No such file or directorydebug1: identity file /home/Crezary Wagner/.ssh/id_dsa type -1debug1: key_load_public: No such file or directorydebug1: identity file /home/Crezary Wagner/.ssh/id_dsa-cert type -1debug1: key_load_public: No such file or directorydebug1: identity file /home/Crezary Wagner/.ssh/id_ecdsa type -1debug1: key_load_public: No such file or directorydebug1: identity file /home/Crezary Wagner/.ssh/id_ecdsa-cert type -1debug1: key_load_public: No such file or directorydebug1: identity file /home/Crezary Wagner/.ssh/id_ed25519 type -1debug1: key_load_public: No such file or directorydebug1: identity file /home/Crezary Wagner/.ssh/id_ed25519-cert type -1debug1: Enabling compatibility mode for protocol 2.0debug1: Local version string SSH-2.0-OpenSSH_7.2debug1: Remote protocol version 2.0, remote software version libssh-0.7.0debug1: no match: libssh-0.7.0debug1: Authenticating to github.com:22 as 'git'debug1: SSH2_MSG_KEXINIT sentdebug1: SSH2_MSG_KEXINIT receiveddebug1: kex: algorithm: curve25519-sha256@libssh.orgdebug1: kex: host key algorithm: ssh-rsadebug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC:  compression: nonedebug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC:  compression: nonedebug1: expecting SSH2_MSG_KEX_ECDH_REPLYdebug1: Server host key: ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8debug1: Host 'github.com' is known and matches the RSA host key.debug1: Found key in /home/Crezary Wagner/.ssh/known_hosts:3debug1: rekey after 134217728 blocksdebug1: SSH2_MSG_NEWKEYS sentdebug1: expecting SSH2_MSG_NEWKEYSdebug1: rekey after 134217728 blocksdebug1: SSH2_MSG_NEWKEYS receiveddebug1: SSH2_MSG_SERVICE_ACCEPT receiveddebug1: Authentications that can continue: publickeydebug1: Next authentication method: publickeydebug1: Offering RSA public key: /home/Crezary Wagner/.ssh/id_rsadebug1: Authentications that can continue: publickeydebug1: Trying private key: /home/Crezary Wagner/.ssh/id_dsadebug1: Trying private key: /home/Crezary Wagner/.ssh/id_ecdsadebug1: Trying private key: /home/Crezary Wagner/.ssh/id_ed25519debug1: No more authentication methods to try.Permission denied (publickey).

最佳答案

如您所想,您应该使用 ssh key 。按照这些步骤在 GitHub 下生成和使用 key 。

Here is how to set it up:

  • 生成一个新的 ssh key (如果您已经有了您提到的 key ,则跳过此步骤)
    ssh-keygen -t rsa -C "your@email"

  • home/.ssh 中设置 key 后目录(或 Windows 下的 Users/<your user>.ssh),打开它并将内容复制到中央存储库下的相关部分(ssh key )。



How to set up ssh key under your GitHub account?

  • 登录 GitHub 账号
  • 点击右上角的 Rancher ( Settings )
    enter image description here
  • 点击 SSH keys and GPG Keys
    enter image description here
  • 点击 New SSH key
    enter image description here
  • 粘贴您的 key 并保存

Note

第一次设置后打开终端并运行 git fetch所以 key 将被测试并添加到您的 known hosts文件。

关于git - 为什么我不能在 Windows 7 上使用 Cygwin SSH 从 Github 克隆存储库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36824803/

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