如何让centos翻墙,我相信这也是经常困扰大家的一个问题,有时经常要下载一些软件,然后看到进度条慢吞吞地,简直就有一种撕心裂肺的痛。文章源自周顺峰个人空间-http://ishangsf.com/2022/03/10/
刚好我们手头又有shadowsocks帐号,但在centos上又不能直接使用,需要一些配置才可以使用。文章源自周顺峰个人空间-http://ishangsf.com/2022/03/10/
所以,经过我的研究,发现了一套很好用的方法,也是很简单的方法,在这里我将告诉大家如何去配置。文章源自周顺峰个人空间-http://ishangsf.com/2022/03/10/
首先,你需要一个shadowsocks帐号,用于翻墙。文章源自周顺峰个人空间-http://ishangsf.com/2022/03/10/
然后我们在centos上安装shadowsocks软件。推荐通过pip
安装。文章源自周顺峰个人空间-http://ishangsf.com/2022/03/10/
很简单文章源自周顺峰个人空间-http://ishangsf.com/2022/03/10/
yum install python-pip
pip install shadowsocks
随后,我们配置好帐号密码,新建/etc/shadowsocks.json
文件:文章源自周顺峰个人空间-http://ishangsf.com/2022/03/10/
{
"server":"your_server_ip", #ss服务器IP
"server_port":your_server_port, #端口
"local_address": "127.0.0.1", #本地ip
"local_port":1080, #本地端口
"password":"your_server_passwd",#连接ss密码
"timeout":300, #等待超时
"method":"rc4-md5", #加密方式
"fast_open": false, # true 或 false。如果你的服务器 Linux 内核在3.7+,可以开启 fast_open 以降低延迟。开启方法: echo 3 > /proc/sys/net/ipv4/tcp_fastopen 开启之后,将 fast_open 的配置设置为 true 即可
"workers": 1 # 工作线程数
}
启动:sslocal -c /etc/shadowsocks.json
文章源自周顺峰个人空间-http://ishangsf.com/2022/03/10/
安装Privoxy
直接使用yum安装即可yum install privoxy
文章源自周顺峰个人空间-http://ishangsf.com/2022/03/10/
安装好后,修改一下配置vim /etc/privoxy/config
文章源自周顺峰个人空间-http://ishangsf.com/2022/03/10/
搜索forward-socks5t
,将forward-socks5t / 127.0.0.1:9050
取消注释并修改为forward-socks5t / 127.0.0.1:1080
文章源自周顺峰个人空间-http://ishangsf.com/2022/03/10/
启动privoxy privoxy /etc/privoxy/config
文章源自周顺峰个人空间-http://ishangsf.com/2022/03/10/
配置/etc/profile
执行vim /etc/profile,添加如下二句:文章源自周顺峰个人空间-http://ishangsf.com/2022/03/10/
` export http_proxy=http://127.0.0.1:8118 export https_proxy=http://127.0.0.1:8118 `文章源自周顺峰个人空间-http://ishangsf.com/2022/03/10/
修改后使配置生效source /etc/profile
文章源自周顺峰个人空间-http://ishangsf.com/2022/03/10/
执行wget www.google.com
判断是否成功文章源自周顺峰个人空间-http://ishangsf.com/2022/03/10/
如果不能访问,请重启机器,依次打开shadowsocks和privoxy再测试文章源自周顺峰个人空间-http://ishangsf.com/2022/03/10/
备注:如果不需要用代理了,记得把bash里的配置注释上,免得把流量跑完了文章源自周顺峰个人空间-http://ishangsf.com/2022/03/10/
- 我的微信
- 这是我的微信扫一扫
-
- 我的微信公众号
- 我的微信公众号扫一扫
-
评论