最近配置了一台构建服务器 但是连接 Maven 源 比较缓慢 所以需要配置一个本地的 SS
安装SS
- 需要用到 pip 先安装
yum install python-pip
- 然后安装 ss
pip install shadowsocks
配置SS
- 创建配置文件
touch /etc/ss.json
- 修改配置文件
vi /etc/ss.json
1
2
3
4
5
6
7{
"server" : "服务器IP地址",
"server_port" : 服务器端口,
"password" : "密码",
"method" : "加密方式",
"remarks" : ""
}
启动SS
- 运行
sslocal -c /etc/ss.json
应该会看到如下内容1
2
3INFO: loading config from /etc/ss.json
2017-04-27 16:21:58 INFO loading libcrypto from libcrypto.so.10
2017-04-27 16:21:58 INFO starting local at 127.0.0.1:1080 - 如果过要外网能够访问 需要加
-b
参数sslocal -c /etc/ss.json -b 0.0.0.0
安装SSR
- 安装 python 和 git
yum install python git
- 克隆项目
git clone https://github.com/maxsky/shadowsocksr-manyuser.git
配置SSR
复制配置文件
cp shadowsocksr-manyuser/config.json ~/shadowsocks.json
修改配置
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25{
"server": "服务器地址",
"server_ipv6": "",
"server_port": 服务器端口,
"local_address": "本地监听地址",
"local_port": 本地端口,
"password": "服务器密码",
"method": "aes-256-cfb", //加密模式
"protocol": "origin", //协议
"protocol_param": "",
"obfs": "tls1.2_ticket_auth", //混淆
"obfs_param": "",
"speed_limit_per_con": 0,
"speed_limit_per_user": 0,
"additional_ports" : {}, // only works under multi-user mode
"additional_ports_only" : false, // only works under multi-user mode
"timeout": 120,
"udp_timeout": 60,
"dns_ipv6": false,
"connect_verbose_info": 0,
"redirect": "",
"fast_open": false
}
启动SSR
- 在刚才Clone的目录执行
1
2
3
4
5
6
7
8[root@server ssr]# python ./shadowsocksr-manyuser/shadowsocks/local.py -c ~/shadowsocks.json -b 0.0.0.0
IPv6 support
2018-08-24 20:07:10 WARNING shell.py:110 warning: local set to listen on 0.0.0.0, it's not safe
2018-08-24 20:07:10 WARNING shell.py:113 warning: server set to listen on 127.0.0.1:8325, are you sure?
2018-08-24 20:07:10 INFO util.py:85 loading libcrypto from libcrypto.so.10
2018-08-24 20:07:10 INFO local.py:50 local start with protocol[origin] password [服务器密码] method [aes-256-cfb] obfs [tls1.2_ticket_auth] obfs_param []
2018-08-24 20:07:10 INFO local.py:54 starting local at 0.0.0.0:1080
2018-08-24 20:07:10 INFO asyncdns.py:324 dns server: [('192.168.0.1', 53)]
使用代理
配置
/etc/profile
添加下列代码1
2
3
4
5http_proxy=http://127.0.0.1:1080/
https_proxy=http://127.0.0.1:1080/
ftp_proxy=http://127.0.0.1:1080/
no_proxy=192.168.0.0,127.0.0.0,localhost
export http_proxy https_proxy ftp_proxy no_proxy配置包管理工具
- CentOs 修改
/etc/yum.conf
文件1
proxy=http://127.0.0.1:8080/
- Debian 修改
/etc/apt/apt.conf
文件1
Acquire::http::Proxy "http://127.0.0.1:1080"
- CentOs 修改
配置
wget
修改/etc/wgetrc
1
2
3
4
5
6
7
8# You can set the default proxies for Wget to use for http, https, and ftp.
# They will override the value in the environment.
#https_proxy = http://proxy.yoyodyne.com:18023/
#http_proxy = http://proxy.yoyodyne.com:18023/
#ftp_proxy = http://proxy.yoyodyne.com:18023/
# If you do not want to use proxy at all, set this to off.
#use_proxy = on使用
proxychains
修改/etc/proxychains.conf
1
socks5 127.0.0.1 1080