Kali linux“;无法解析主机github.com“;错误
我正在尝试下载发现脚本,并一直使用Kali linux“;无法解析主机github.com“;错误,linux,git,github,ssh,Linux,Git,Github,Ssh,我正在尝试下载发现脚本,并一直使用git clone作为命令。运行时,它返回: git clone https://github.com/leebaird/discover.git Cloning into 'discover'... remote: Counting objects: 4217, done. remote: Compressing objects: 100% (34/34), done. error: RPC failed; result=56, HTTP code = 200
git clone
作为命令。运行时,它返回:
git clone https://github.com/leebaird/discover.git
Cloning into 'discover'...
remote: Counting objects: 4217, done.
remote: Compressing objects: 100% (34/34), done.
error: RPC failed; result=56, HTTP code = 200 | 445.00 KiB/s
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
<code>
OpenSSH_7.1p2 Debian-1, OpenSSL 1.0.2e 3 Dec 2015
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to github.com [192.30.252.121] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: SELinux support disabled
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.1p2 Debian-1
debug1: Remote protocol version 2.0, remote software version libssh-0.7.0
debug1: no match: libssh-0.7.0
debug1: Authenticating to github.com:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client chacha20-poly1305@openssh.com <implicit> none
debug1: kex: client->server chacha20-poly1305@openssh.com <implicit> none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
The authenticity of host 'github.com (192.30.252.121)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added 'github.com,192.30.252.121' (RSA) to the list of known hosts.
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: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Trying private key: /root/.ssh/id_ecdsa
debug1: Trying private key: /root/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).
</code>
因此,我试图通过以下方式更改我的代理:
<code>
export GIT_TRACE_PACKET=1
export GIT_TRACE=1
export GIT_CURL_VERBOSE=1</code>
这修复了围绕RPC失败错误的问题。但是,它现在会出现更多错误:
<code>
11:32:36.928104 git.c:348 trace: built-in: git 'clone' 'https://github.com/leebaird/discover.git'
Cloning into 'discover'...
11:32:36.931252 run-command.c:343 trace: run_command: 'git-remote-https' 'origin' 'https://github.com/leebaird/discover.git'
* Couldn't find host github.com in the .netrc file; using defaults
* Could not resolve host: github.com
* Closing connection 0
fatal: unable to access 'https://github.com/leebaird/discover.git/': Could not resolve host: github.com
</code>
所以我决定通过运行“ssh-v”,看看是否可以看到某种形式的改变git@github.com
`返回的目标:
git clone https://github.com/leebaird/discover.git
Cloning into 'discover'...
remote: Counting objects: 4217, done.
remote: Compressing objects: 100% (34/34), done.
error: RPC failed; result=56, HTTP code = 200 | 445.00 KiB/s
fatal: The remote end hung up unexpectedly
fatal: early EOF
fatal: index-pack failed
<code>
OpenSSH_7.1p2 Debian-1, OpenSSL 1.0.2e 3 Dec 2015
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to github.com [192.30.252.121] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: SELinux support disabled
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /root/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.1p2 Debian-1
debug1: Remote protocol version 2.0, remote software version libssh-0.7.0
debug1: no match: libssh-0.7.0
debug1: Authenticating to github.com:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client chacha20-poly1305@openssh.com <implicit> none
debug1: kex: client->server chacha20-poly1305@openssh.com <implicit> none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
The authenticity of host 'github.com (192.30.252.121)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? y
Please type 'yes' or 'no': yes
Warning: Permanently added 'github.com,192.30.252.121' (RSA) to the list of known hosts.
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: Trying private key: /root/.ssh/id_rsa
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Trying private key: /root/.ssh/id_ecdsa
debug1: Trying private key: /root/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).
</code>
我不确定如何继续或如何修复我的设置以允许克隆。我只需要修复它,这样我就可以下载并继续
在.netrc文件中找不到主机github.com
。所以你可以解析“github.com”。。。只是先看看netrcdebug1:尝试私钥:/root/.ssh/id\u rsa
debug1:正在尝试私钥:/root/.ssh/id\u dsa
debug1:正在尝试私钥:/root/.ssh/id\u ecdsa
debug1:正在尝试私钥:/root/.ssh/id_ed25519
debug1:不再尝试验证方法。
权限被拒绝(公钥)。
git克隆https://github.com/leebaird/discover.git
以下是我得到的,没有任何特殊标志或特殊配置:
git克隆
克隆到“发现”。。。
远程:计数对象:4217,完成。
远程:压缩对象:100%(34/34),完成。
远程:总计4217(增量18),重复使用0(增量0),包重复使用4183
接收对象:100%(4217/4217),25.15 MiB | 5.07 MiB/s,完成。
解析增量:100%(2855/2855),完成。
你为我节省了一段非常痛苦的时间,哈哈。非常感谢你的帮助。