Linux(CentOS and Ubuntu)安装Shadowsocks服务端server教程

来源:互联网 发布:手机图片制作软件 编辑:程序博客网 时间:2024/05/16 11:37

安装 Shadowsocks

Ubuntu

apt-get install python-pippip install shadowsocks

CentOS

yum install python-setuptools && easy_install pippip install shadowsocks

配置

创建配置文件: /etc/shadowsocks.json

内容如下:

{    "server":"1.2.3.4", // 服务器IP    "server_port":8888, // 对外提供服务的端口    "local_port":1080,    "password":"your password",    "timeout":600,    "method":"aes-256-cfb"}

如果需要分配多个帐号,配置如下:

{    "server":"1.2.3.4",    "port_password":{        "8888":"password1",        "8889":"password2",        "8890":"password3",        "8891":"password4"    },    "timeout":600,    "method":"aes-256-cfb"}

Shadowsocks 官方使用说明: 前去阅读

启动 Shadowsocks

前台启动

ssserver -c /etc/shadowsocks.json

后台运行

ssserver -c /etc/shadowsocks.json -d start # 启动ssserver -c /etc/shadowsocks.json -d stop # 停止

安装 Supervisor

通常情况下,我们不希望每次系统启动的时候手动去启动进程和服务,这时候,我们需要一个进程管理工具,这里介绍使用的是 Supervisor。 Supervisor 介绍、安装和使用的教程详见: Supervisor 安装使用教程

使用 Supervisor 管理 Shadowsocks 的配置如下,在 /etc/supervisord.conf 中添加:

[program:shadowsocks]command=ssserver -c /etc/shadowsocks.jsonautostart=trueautorestart=trueuser=rootlog_stderr=truelogfile=/var/log/shadowsocks.log

Shadowsocks 配置完毕。

1 0
原创粉丝点击