当前位置: 首页 > Linux

让远程服务器在本地电脑上使用Yogurt的socks5代理

时间:2023-04-06 12:10:13 Linux

初始设置首先确认Yogurt的sock5端口,默认为端口:1080n右下角程序图标右击,选择选项设置,找到对应的选项然后点击在xshell中查找对应的远程服务器会话,找到属性中的tunnel,n如图,输入(远程传入)>源主机为本机,目标主机为远程服务器,具体设置默认为localhost/1080usinggitsocks5代理快捷开关#!/bin/bash#vim/usr/bin/gitchangeaddscriptcase$1in"on")if[-z"$2"];thengitconfig--globalhttp.proxy'socks5://127.0.0.1:1080'gitconfig--globalhttps.proxy'socks5://127.0.0.1:1080'否则gitconfig--globalhttp.proxy"socks5://127.0.0.1:$2"gitconfig--globalhttps.代理"socks5://127.0.0.1:$2"fi;;"off")gitconfig--global--unsethttp.proxygitconfig--global--unsethttps.proxy;;"status")echo'http.proxy='`gitconfig--gethttp.proxy`echo'https.proxy='`gitconfig--gethttps.proxy`;;*)echo'#git代理配置1.执行默认的全局socks5代理规则[在]2。自定义socks5端口[$2]3。清除全局代理规则[关闭]4。查看全局代理规则[status]';esacaddpermissionchmod+x/usr/bin/gitchange&&gitchange继续学习