关键词: centos, shadowsocks, vpn, 翻墙
我之前是花钱买的vpn,当时买的一年89块钱,叫做“一枝红杏”。经常会遇到网络不好用等问题,今天又遇到了,于是便想尝试自己搭建,没想到用shadowsocks这么简单。
我因为经常使用阿里云,服务器自然就买了阿里云海外服务器。
自己搭建的优点:
1、带宽稳定,不会出现很多用户同时在线时网速慢。
2、网络稳定,网络连通方面阿里云去解决。
3、数据完全,使用别人的有可能担心数据泄露,自己的就不会了。
自建缺点:
1、费用较贵,买一台最低配的服务器也79一个月,这不包括带宽费用。
2、出问题需要自己运维。
很简单:
1、安装python pip环境,一般都自带。
1 2 |
yum -y install epel-release yum -y install python-pip |
2、pip 安装 shadowsocks
pip install shadowsocks
3、创建配置文件
1 2 3 4 5 6 7 8 9 10 11 12 |
vi /etc/shadowsocks.json { "server":"0.0.0.0", "port_password":{ "8381":"abc121", "8382":"abc122" }, "timeout":120, "method":"aes-256-cfb", "fast_open":true, "workers":1 } |
4、启动
ssserver -c /etc/shadowsocks.json -d start
关闭:
ssserver -d stop
客户端:
windows: https://github.com/shadowsocks/shadowsocks-windows/releases
ubuntu: 客户端安装
1 2 3 |
sudo add-apt-repository ppa:hzwhuang/ss-qt5 sudo apt-get update sudo apt-get install shadowsocks-qt5 |
mac下载地址:
https://github.com/shadowsocks/shadowsocks-iOS/releases
安装上面会出现一个像飞机的东西,如下图:

右边: “打开服务器设定…”
填入相关信息,包括:地址、端口、加密方式、密码等。
然后选择全局模式,登录一下其他网站,或者 http://www.ip.cn/ ,查看自己ip是否是自己国外服务器的ip。
如果是,那么成功了。
全局模式的时候,访问国内网站会变得慢。那么我们就需要采用自动代理模式,通过PAC文件,告知哪些使用代理,哪些直接访问。
ok啦,有问题留言吧。
————————ubuntu 翻墙
1、开本地代理。 2、firefox使用本地代理
本地链接翻墙服务器。
sudo apt install shadowsocks
pip install https://github.com/shadowsocks/shadowsocks/archive/master.zip -U
pip install shadowsocks
都试试,直到有sslocal命令
sslocal -s your_ip -p your_port -k your_password -l 1080 -m aes-256-cfb
火狐浏览器:about:preferences#advanced
网络设置,
Manual proxy configuration: SOCKS v5
代理:127.0.0.1 1080
命令行使用代理:
1 |
git clone https: |
1 |
//github |
1 |
.com |
1 |
/rofl0r/proxychains-ng |
1 |
cd |
1 |
proxychains-ng |
1 |
. |
1 |
/configure |
1 |
make |
1 |
&& |
1 |
make |
1 |
install |
1 |
1 |
[root@thatsit proxychains-ng] |
1 |
# tail -2 /usr/local/etc/proxychains.conf |
1 |
#socks4 127.0.0.1 9050 #==> 原始配置 |
1 |
socks5 127.0.0.1 1080 |
============================
ubuntu翻墙
1、安装sudo apt-get install shadowsocks 【一定要安装】
2、dpkg -i electron-ssr_0.2.3_amd64.deb
注意第一布未安装,第二步软件有问题。