Shadowsocks多用户管理平台

本文讲解在Archlinux中架设Shadowsocks多用户管理平台的方法。

安装Python环境

pip install cymysql shadowsocks m2crypto

安装shadowsocks服务后台

1.下载源码

git clone -b manyuser https://github.com/mengskysama/shadowsocks.git
cd /root/shadowsocks/shadowsocks

2.创建shadowsocks数据库

create database shadowsocks; --创建数据库
CREATE USER ss@localhost IDENTIFIED BY 'ss';  --创建WP用户和密码
GRANT ALL PRIVILEGES ON shadowsocks.* TO ss@localhost; --授予权限
FLUSH PRIVILEGES;  --刷新配置

若要开启开启mysql远程访问,具体可参考How to Allow MySQL Remote Access in Ubuntu Server 16.04

GRANT ALL ON shadowsocks.* TO aa@'%' IDENTIFIED BY 'sa';

3.导入后台配置

use shadowsocks;
source /root/shadowsocks/shadowsocks/shadowsocks.sql
flush privileges;
exit;

4.修改Config.py

#Config
MYSQL_HOST = 'mdss.mengsky.net'
MYSQL_PORT = 3306
MYSQL_USER = 'ss'
MYSQL_PASS = 'ss'
MYSQL_DB = 'shadowsocks'

MANAGE_PASS = 'ss233333333'
#if you want manage in other server you should set this value to global ip
MANAGE_BIND_IP = '127.0.0.1'
#make sure this port is idle
MANAGE_PORT = 23333

安装shadowsocks前台

git clone https://github.com/orvice/ss-panel.git

curl -sS https://getcomposer.org/installer | php
php composer.phar  install

修改配置

cd ss-panel/lib/
cp config-simple.php config.php
vim config.php
同样的修改数据库等信息 登陆Mysql ,执行前台的SQL
use shadowsocks;
source /root/ss-panel/sql/invite_code.sql
source /root/ss-panel/sql/ss_user_admin.sql
source /root/ss-panel/sql/ss_node.sql
source /root/ss-panel/sql/ss_reset_pwd.sql
source /root/ss-panel/sql/user.sql
flush privileges;
exit;
执行服务
nohup python2.7  /root/shadowsocks/shadowsocks/server.py > /var/log/shadowsocks.log 2>&1 &
查看日志
cat /var/log/shadowsocks.log
如果出现以下文字,则表明执行成功。
db start server at port [%s] pass [%s]
将前端文件移至web目录, 通过浏览器访问即可。
cp -rd /root/ss-panel/* /var/www/html

我的SS平台

有需要的小伙伴可以找我注册,地址为:我的科学上网服务使用指南

坚持原创技术分享,您的支持将鼓励我继续创作!