1

在 Windows 10 上使用 Smartgit v7.1;我在 Smartgit 中打开Git-shell并运行此命令 ( git fetch --all ) 以在 Bitbucket 服务器上克隆一个 repo:

但我收到以下错误:

$ git fetch --all
Fetching origin
Could not create directory '/h/.ssh'.
The authenticity of host 'bitbucket.domainName.net (00.00.000.00)' can't be established.
RSA key fingerprint is SHA256:POU+5KMU6lliH44u4J5fe7/WREtZZzrFamHLYqvql5g.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/h/.ssh/known_hosts).
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
error: Could not fetch origin

我也尝试运行此命令但没有成功:

$ ssh -vT git@bitbucket.domainName.net

OpenSSH_7.1p1, OpenSSL 1.0.2d 9 Jul 2015
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to bitbucket.domainName.net [10.10.200.68] port 22.
debug1: Connection established.
Could not create directory '/h/.ssh'.
debug1: key_load_public: No such file or directory
debug1: identity file /h/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /h/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /h/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /h/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /h/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /h/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /h/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /h/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.1
debug1: Remote protocol version 2.0, remote software version SSHD-CORE-0.14.1-ATLASSIAN-01
debug1: no match: SSHD-CORE-0.14.1-ATLASSIAN-01
debug1: Authenticating to bitbucket.domainName.net:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-sha2-256 none
debug1: kex: client->server aes128-ctr hmac-sha2-256 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:HFU+5KVL6lliH44u4m5fe7/YAHtZZzrFamHLYqvql5g
The authenticity of host 'bitbucket.domainName.net (10.10.200.68)' can't be established.
RSA key fingerprint is SHA256:HFU+5KVL6lliH44u4m5fe7/YAHtZZzrFamHLYqvql5g.
Are you sure you want to continue connecting (yes/no)? yes
Failed to add the host to the list of known hosts (/h/.ssh/known_hosts).
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Trying private key: /h/.ssh/id_rsa
debug1: Trying private key: /h/.ssh/id_dsa
debug1: Trying private key: /h/.ssh/id_ecdsa
debug1: Trying private key: /h/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).

之前有人在 Windows 10 上使用 Smartgit Git-Shell 遇到过这个问题( 我通过打开 SmartGit 进入 Git-Shell,然后是 Tools > Open Git-Shell)?

4

1 回答 1

1

默认情况下,SmartGit 将使用其内置的 SSH 客户端,该客户端仅在直接从 SmartGit 中调用命令时才起作用。SSH 客户端将不可用于外部工具,例如 Git-Shell。

如果您确实需要从 Git-Shell 运行远程命令,则必须配置 Git 自己的 SSH 客户端。

于 2016-02-17T17:39:46.673 回答