被github正确的ip和443端口拒绝
- 经常出现:
zhangbin@LAPTOP-DFV9CMRA MINGW64 /g/CDN/net/libuv-dev/net_uv_new-kcp-imui-gl (main)
$ git push origin main
Connection reset by 20.205.243.160 port 443
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
检查: ssh -vT git@github.com
zhangbin@LAPTOP-DFV9CMRA MINGW64 /g/CDN/net/libuv-dev/net_uv_new-kcp-imui-gl (main)
$ git push origin main
Connection reset by 20.205.243.160 port 443
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
zhangbin@LAPTOP-DFV9CMRA MINGW64 /g/CDN/net/libuv-dev/net_uv_new-kcp-imui-gl (main)
$ ssh -vT [email protected]
OpenSSH_9.1p1, OpenSSL 1.1.1s 1 Nov 2022
debug1: Reading configuration data /c/Users/zhangbin/.ssh/config
debug1: /c/Users/zhangbin/.ssh/config line 3: Applying options for github.com
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to ssh.github.com [20.205.243.160] port 443.
debug1: Connection established.
debug1: identity file /c/Users/zhangbin/.ssh/id_rsa type0
debug1: identity file /c/Users/zhangbin/.ssh/id_rsa-cert type -1
debug1: identity file /c/Users/zhangbin/.ssh/id_ecdsa type -1
debug1: identity file /c/Users/zhangbin/.ssh/id_ecdsa-cert type -1
debug1: identity file /c/Users/zhangbin/.ssh/id_ecdsa_sk type -1
debug1: identity file /c/Users/zhangbin/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /c/Users/zhangbin/.ssh/id_ed25519 type -1
debug1: identity file /c/Users/zhangbin/.ssh/id_ed25519-cert type -1
debug1: identity file /c/Users/zhangbin/.ssh/id_ed25519_sk type -1
debug1: identity file /c/Users/zhangbin/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /c/Users/zhangbin/.ssh/id_xmss type -1
debug1: identity file /c/Users/zhangbin/.ssh/id_xmss-cert type -1
debug1: identity file /c/Users/zhangbin/.ssh/id_dsa type -1
debug1: identity file /c/Users/zhangbin/.ssh/id_dsa-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_9.1
debug1: Remote protocol version 2.0, remote software version babeld-4b034cc8
debug1: compat_banner: no match: babeld-4b034cc8
debug1: Authenticating to ssh.github.com:443 as 'git'
debug1: load_hostkeys: fopen /c/Users/zhangbin/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ssh-ed25519
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
Connection reset by 20.205.243.160 port 443
看起来dns是对的
zhangbin@LAPTOP-DFV9CMRA MINGW64 /g/CDN/net/libuv-dev/net_uv_new-kcp-imui-gl (main)
$ nslookup github.com 8.8.8.8
Non-authoritative answer:
Server: dns.google
Address: 8.8.8.8
Name: github.com
Address: 20.205.243.166
zhangbin@LAPTOP-DFV9CMRA MINGW64 /g/CDN/net/libuv-dev/net_uv_new-kcp-imui-gl (main)
$ nslookup ssh.github.com 8.8.8.8
Non-authoritative answer:
Server: dns.google
Address: 8.8.8.8
Name: ssh.github.com
Address: 20.205.243.160
全局proxy不行
zhangbin@LAPTOP-DFV9CMRA MINGW64 /g/CDN/net/libuv-dev/net_uv_new-kcp-imui-gl (main)
$ exporthttps_proxy=http://127.0.0.1:7890
exporthttp_proxy=http://127.0.0.1:7890
exportall_proxy=socks5://127.0.0.1:7891
zhangbin@LAPTOP-DFV9CMRA MINGW64 /g/CDN/net/libuv-dev/net_uv_new-kcp-imui-gl (main)
$
zhangbin@LAPTOP-DFV9CMRA MINGW64 /g/CDN/net/libuv-dev/net_uv_new-kcp-imui-gl (main)
$ git push -u origin main
Connection reset by 20.205.243.160 port 443
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
加了git的proxy 不行
$ git config --global http.proxy "socks5://127.0.0.1:7891"git config --global https.proxy "socks5://127.0.0.1:7891"
加了nc 的没权限
- nc sock5
$ cat ~/.ssh/config
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedAlgorithms +ssh-rsa
Host github.com
Hostname ssh.github.com
Port 443
User git#socks5#ProxyCommand nc -X 5 -x 127.0.0.1:7891 %h %p
zhangbin@LAPTOP-DFV9CMRA MINGW64 /g/CDN/net/libuv-dev/net_uv_new-kcp-imui-gl (main)
$ git push origin main
/usr/bin/bash: line 1: /g/ISOFT/netcat-win32-1.12/nc: Permission denied
/usr/bin/bash: line 1: /g/ISOFT/netcat-win32-1.12/nc: No error
kex_exchange_identification: Connection closed by remote host
Connection closed by UNKNOWN port 65535
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
实测,这个可以
- connect proxy
Host github.com
User git
ProxyCommand connect -H 127.0.0.1:7890 %h %p
本文转载自: https://blog.csdn.net/commshare/article/details/130523009
版权归原作者 等风来不如迎风去 所有, 如有侵权,请联系我们删除。
版权归原作者 等风来不如迎风去 所有, 如有侵权,请联系我们删除。