CENTOS7搭建SSSERVER
ss服务器安装
sudo yum install python-setuptools
sudo easy_install pip
sudo pip install shadowsocks
因为shadowsocks服务器版本需要python支撑,因此需先安装paython环境。
当看到如下日志,说明安装成功。
[centos@ip-17 ~]$ sudo pip install shadowsocks
DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won't be maintained after that date. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting shadowsocks
Downloading https://files.pythonhosted.org/packages/02/1e/e3a5135255d06813aca6631da31768d44f63692480af3a1621818008eb4a/shadowsocks-2.8.2.tar.gz
Installing collected packages: shadowsocks
Running setup.py install for shadowsocks ... done
Successfully installed shadowsocks-2.8.2
shadowsocks服务器配置
在/etc文件下创建shadowsocks.json配置文件。即通过如下命令:
sudo vim /etc/shadowsocks.json
在其中写入如下配置:
{
"server": "0.0.0.0",
"local_address": "127.0.0.1",
"local_port": 1080,
"port_password": {
"8888": "password"
},
"timeout": 600,
"method": "aes-256-cfb"
}
其中参数解析如下:
- server 表示监听的地址,这里表示监听所有的地址;
- local_address:本地地址
- local_port:本地端口
- port_password:监听外部请求的端口和对应的密码;此处可以配置多个,以逗号分隔。
- timeout:超时时间600秒。
- method:通信加密方式。
启动或停止服务
启动命令:
sudo ssserver -c /etc/shadowsocks.json -d start
停止命令:
sudo ssserver -c /etc/shadowsocks.json -d stop
客户端配置
shadowsocks客户端下载地址:https://github.com/shadowsocks/ShadowsocksX-NG/releases
下载对应的版本安装,然后依次选择服务器–服务器设置,然后新增一个配置,相关参数就是我们上面json文件中配置的参数。