这两天好像 github 拉取推送都超时了~
在 ~/.ssh/config 中添加
Host github.com
User git
HostName github.com
ProxyJump proxyserver
Host proxyserver
User root
HostName your_server_ip
IdentityFile xxx
其中 proxyserver 是你 hk 或海外可以直连 github 的服务器
感谢5楼提供的方案, 直接使用已有代理更加简单方便
Host github.com
User git
HostName github.com
ProxyCommand ncat --proxy-type socks5 --proxy 127.0.0.1:9999 %h %p
提示没有ncat的话需要先安装
![]() |
1
FabricPath 4 天前
有点麻烦,还是:
1. 家里软路由部署透明代理 2. 出门在外打洞回家,从家里代理出去 一劳永逸 |
2
coolcoffee 4 天前
最好不要用 ssh 大流量跑,速度慢不说还很容易被墙给干掉的。 正确的做法还是应该走本地的 socks5 服务器🐶
|
![]() |
3
irrigate2554 4 天前
透明代理 + https 协议拉取
|
4
fuzzsh 4 天前 via Android
既然你都有国际服务器了,本地开 proxy 算是基础,为什么不直接用 Proxycommand……
|
5
superrichman 4 天前 ![]() 直接上 ProxyCommand ,随便弄个代理都能用
ProxyCommand ncat --proxy-type socks5 --proxy 127.0.0.1:9999 %h %p |
![]() |
6
mrgeneral 4 天前
直接 TUN 接管
|
7
bigtear 4 天前
偶尔简单用一下还不错
ssh 大流量容易被盯上或者阻断 |
![]() |
8
waklealone 4 天前
surge 增强模式就行
|
![]() |
9
jiangzm 4 天前 ![]() ProxyCommand nc -v -x 127.0.0.1:7890 %h %p
|
![]() |
10
Lychee0 4 天前
tun mode 解君愁
|
![]() |
11
Tiande PRO |
![]() |
12
skiy 4 天前 via iPhone
用这个: https://github.com/shunf4/proxychains-windows
linux 平台也有。proxychains git 这样胜,在命令行前面加 proxychains 就行了(首先要加入 PATH ) |
![]() |
13
skiy 4 天前 via iPhone
up 的环境看起来不像 win ,那就用正面这个。自己 build 一下就行了,c 写的。
https://github.com/rofl0r/proxychains-ng |
![]() |
14
kennylam777 4 天前
年輕人終究是年輕人, 太衝動了, 不知道牆有多高, 觸發阻斷的流量有多大.......
|
![]() |
15
wangtian2020 4 天前
感觉不如 tun 模式启动
|
16
jocover 4 天前
直接用 proxychains 就行了,你这个太麻烦了
|
![]() |
17
starrys 4 天前
温馨提示:国内使用代理访问 github 最快的是日本节点。
|
18
kristofer 4 天前
直接 tun ,折腾那么多太费事了,还不一定稳。
|
![]() |
19
UnluckyNinja 4 天前 ![]() windows 应该不需要额外安装别的,一直用的下面这个,忘记从哪个 stackoverflow 捞来的了
Host github.com User git ProxyCommand connect -S localhost:7890 %h %p Hostname ssh.github.com Port 443 |
![]() |
20
BitGeek 4 天前
我在 linux 里的方案是直接在/etc/profile 里添加 all_proxy=...
|
![]() |
21
Oxygen2025 4 天前
直接开 tun 模式就行了
|
![]() |
22
wweir 4 天前
现在,是更推荐使用 HTTPS 方式拉取,而不是 SSH 的,这样的话,一行命令解决所有问题:
git config --global http.https://github.com.proxy socks5h://127.0.0.1:1080 |
![]() |
23
tayuo 4 天前
|
24
wenrouxiaozhu 4 天前
╰─ alias proxy 100%
proxy='export https_proxy=http://127.0.0.1:7890;export http_proxy=http://127.0.0.1:7890;export all_proxy=socks5://127.0.0.1:7890' 我是这样 |
25
gsw945 4 天前 via iPhone
我一般是用 #13 楼 说的 proxychains-ng 配置 socks5 ,本机 clash 允许局域网连接,服务器上除了不依赖 gLibC 的的程序(一般纯 go 的),基本都能用。
|
![]() |
26
liyafe1997 4 天前
我一般直接 proxychains git xxx
|
![]() |
27
SeanChang PRO ![]() |
![]() |
28
gongym 3 天前
为什么不直接配置.gitconfig 。又改 ssh 又改 host 。不麻烦嘛
|
29
realJamespond 3 天前
用了很多年了,用 ssh config 基本不需要啥 xshell securtcrt 之类的了
ProxyCommand nc -X 5 -x localhost:1080 %h %p |
![]() |
30
totoro52 3 天前
tun 不就完事了
|
![]() |
31
taowen 3 天前
|
32
w568w 3 天前
ncat 会有一些上传下载的性能问题,跑不满带宽。可以试试我之前搞的代理小工具: https://github.com/w568w/sucks5
|
![]() |
33
flyqie 1 天前 via Android
现在为什么要用 ssh 呢,不太理解。
感觉 http/https 拉取和推送一般来说也能满足需求吧? |
34
jmliubiao 19 小时 41 分钟前
直接导入到码云上,从码云上拉取
|