织梦CMS - 轻松建站从此开始!

欧博ABG官网-欧博官方网址-会员登入

>欧博;从此告别git clone几KiB/s了

时间:2025-01-28 16:30来源: 作者:admin 点击: 7 次
windows 设置代理 http || https协议 //设置全局代理 //http git config --global https.proxy http://127.0.0.1:7891 //https git config --global https.proxy https://127

windows 设置代理 http || https协议 //设置全局代理 //http git config --global https.proxy :7891 //https git config --global https.proxy https://127.0.0.1:7891 // socks git config --global http.proxy socks5://127.0.0.1:7891 git config --global https.proxy socks5://127.0.0.1:7891 //只对github.com使用代理,欧博其他仓库不走代理 git config --global http.https://github.com.proxy socks5://127.0.0.1:7891 git config --global https.https://github.com.proxy socks5://127.0.0.1:7891 //取消github代理 git config --global --unset http.https://github.com.proxy git config --global --unset https.https://github.com.proxy //取消全局代理 git config --global --unset http.proxy git config --global --unset https.proxy SSH协议 //对于使用git@协议的,皇冠可以配置socks5代理 //在~/.ssh/config 文件后面添加几行,DG游戏没有可以新建一个 //socks5 Host github.com User git ProxyCommand connect -S 127.0.0.1:7891 %h %p //http || https Host github.com User git ProxyCommand connect -H 127.0.0.1:7891 %h %p WSL2设置代理

在 Ubuntu 子系统中,欧博注册通过 cat /etc/resolv.conf 查看 DNS 服务器 IP

cat /etc/resolv.conf # This file was automatically generated by WSL. To stop automatic generation of this file, add the following entry to /etc/wsl.conf: # [network] # generateResolvConf = false nameserver 172.23.64.1

其实上面地址就是windows下面这个ip地址
win11->设置->网络和Internet->高级网络设置->硬件和连接属性
名称:vEthernet (WSL)
ipv4地址:172.23.64.1/20

我们要为WSL配置ssh代理和http代理

touch ~/.ssh/config vim ~/.ssh/config Host github.com HostName github.com User git # 走 socks5 代理 ProxyCommand nc -v -x 172.28.32.1:7891 %h %p

使用下面命令检查ssh代理配置是否成功

ssh -T github.com Connection to github.com 22 port [tcp/ssh] succeeded! Hi wq-zhijun! You've successfully authenticated, but GitHub does not provide shell access.

可以将上面ip地址配置代理写入到.bashrc文件中,欧博代理这样就可以自己用户开机永久生效,
另外apt要单独在/etc/apt/apt.conf设置代理

export u_host=`cat /etc/resolv.conf|grep nameserver|awk '{print $2}'` sed -i "/.*ProxyCommand*/c\ ProxyCommand nc -v -x $u_host:7891 %h %p" ~/.ssh/config proxy () { export ALL_PROXY="http://$u_host:7891" export all_proxy="http://$u_host:7891" export {http,https,ftp}_proxy=$ALL_PROXY export {HTTP,HTTPS,FTP}_PROXY=$ALL_PROXY echo -e "Acquire::http::Proxy \"http://$u_host:7891\";" | sudo tee -a /etc/apt/apt.conf > /dev/null echo -e "Acquire::https::Proxy \"http://$u_host:7891\";" | sudo tee -a /etc/apt/apt.conf > /dev/null curl ip.gs } proxy # default call proxy noproxy () { unset ALL_PROXY unset all_proxy sudo sed -i -e '/Acquire::http::Proxy/d' /etc/apt/apt.conf sudo sed -i -e '/Acquire::https::Proxy/d' /etc/apt/apt.conf curl ip.gs }

7891端口是clash for windows端口,另外将Allow LAN打开。

还需要将防火墙打开
win+r 输入 control到如下目录
控制面板\系统和安全\Windows Defender 防火墙
放行clash*

git push失败或者卡住不动问题

原因是有的节点22端口被服务端封锁了,要么改服务端端口要么改自己本地更换443端口(~/.ssh/config))

# 可以先使用如下测试下 ssh -T -p 443 git@ssh.github.com # Hi USERNAME! You've successfully authenticated, but GitHub does not # provide shell access. # 更换端口后再测试下 ssh -T git@github.com # Hi USERNAME! You've successfully authenticated, but GitHub does not # provide shell access. # .ssh目录的config文件添加如下内容 vim ~/.ssh/config Host github.com HostName github.com User git # set socks5 proxy ProxyCommand nc -v -x 172.23.64.1:7891 %h %p 参考链接

Git设置代理
为 WSL2 一键设置代理
WSL2配置代理
wsl2 proxy
HTTPS_PROXY vs https_proxy

SSH 防爆破与 Fail2Ban 加固
解决 push 到 GitHub 异常 - 无法连接22端口
Using SSH over the HTTPS port
How to solve "Extra junk at end of file" when using apt?
Ubuntu「一键」设置代理

(责任编辑:)
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
用户名: 验证码:
发布者资料
查看详细资料 发送留言 加为好友 用户等级: 注册时间:2025-02-22 16:02 最后登录:2025-02-22 16:02
栏目列表
推荐内容