繁体   English   中英

远程窗口中的git clone不起作用

[英]git clone in remote windows doesn't work

我有一台可以通过SSH访问的Windows 7计算机。 我想使用SSH协议在该计算机的特定目录中克隆git repo。 我试图通过使用SSH(PuTTY)登录到远程Windows 7计算机来克隆存储库,但是在控制台上出现以下错误:

git@xyz-github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

但是我可以通过远程桌面(mstsc)或VNC查看器克隆相同的存储库。 有人可以帮我解决腻子方法中缺少的内容吗? 最终,我想使用Python和Fabric自动化克隆过程。

这是ssh git@xyz-github.com -v的输出:

OpenSSH_7.6p1, OpenSSL 1.0.2m  2 Nov 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to xyz-github.com [xxx.yyy.zzz.www] port 22.
debug1: Connection established.
debug1: identity file /c/Users/admin/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/admin/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/admin/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/admin/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/admin/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/admin/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/admin/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /c/Users/admin/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6
debug1: Remote protocol version 2.0, remote software version libssh-0.7.0
debug1: no match: libssh-0.7.0
debug1: Authenticating to xyz-github.com:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: aes128-ctr MAC: hmac-sha2-256 compression: none
debug1: kex: client->server cipher: aes128-ctr MAC: hmac-sha2-256 compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:YppvE1IGqHnKCcW9FqBzT4wBdyHxS0XBChnQNu4zCn0
debug1: Host 'xyz-github.com' is known and matches the ECDSA host key.
debug1: Found key in /c/Users/admin/.ssh/known_hosts:1
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 4294967296 blocks
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:yJ5QUUudzMLgW4w8x1o5idxyGbqmeoLilEPiKQnM5gs /c/Users/admin/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentication succeeded (publickey).
Authenticated to xyz-github.com ([xxx.yyy.zzz.www]:22).
debug1: channel 0: new [client-session]
debug1: Entering interactive session.
debug1: pledge: network
PTY allocation request failed on channel 0
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
Hi rakesh! You've successfully authenticated, but GitHub does not provide shell access.
debug1: channel 0: free: client-session, nchannels 1
Connection to xyz-github.com closed.
Transferred: sent 2880, received 1384 bytes, in 0.5 seconds
Bytes per second: sent 5594.4, received 2688.4
debug1: Exit status 1

也许有证书助手可以完成这项工作?

最终git config --list --show-origin应该看起来像这样:

file:"C:\\Git\\mingw64/etc/gitconfig"   credential.helper=manager
file:C:/Users/user/.gitconfig    credential.helper=wincred
file:.git/config        remote.origin.url=https://github.com/xy

有关详细信息,请参见此问题

暂无
暂无

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

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