Debian/Ubuntu 下的SS多用户配置

2015-09-02 11:04

安装:

apt-get update

apt-get install python-pip

pip install shadowsocks


配置单用户(单用户与下面的多用户二选一):

vi /etc/shadowsocks.json

{
"server":"0.0.0.0",
"server_port":端口,
"local_address": "127.0.0.1",
"local_port":1080,
"password":"密码",
"timeout":120,
"method":"aes-256-cfb"
}



配置多用户:

配置多用户:
vi /etc/shadowsocks.json
{
    "server": "0.0.0.0",
    "port_password": {
"端口一": "密码一",
"端口二": "密码二",
"端口三": "密码三"
    },
    "timeout": 120,
    "method": "aes-256-cfb"
}


配置SS服务:

vi /etc/init.d/ss

#!/bin/sh

### BEGIN INIT INFO
# Provides:          shadowsocks
# Required-Start:    $local_fs $remote_fs $network $syslog
# Required-Stop:     $local_fs $remote_fs $network $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts the shadowsocks
# Description:       Shadowsocks is a secured socks5 proxy, designed to protect your internet traffic.
### END INIT INFO

start(){
/usr/bin/python /usr/local/bin/ssserver -c /etc/shadowsocks.json -d start
}

stop(){
/usr/bin/python /usr/local/bin/ssserver -c /etc/shadowsocks.json -d stop
}

case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage: $0 {start|restart|stop}"
exit 1
;;
esac

exit 0


配置SS开机自启:

update-rc.d ss defaults


移除开机自启:

update-rc.d -f ss remove







最后更新:2015-12-30 14:19

1 条回复

说两句