Debian通过自编译shadowsocks-libev源码搭建shadowsocks - 忆未来

Debian通过自编译shadowsocks-libev源码搭建shadowsocks

Debian通过自编译shadowsocks-libev源码搭建shadowsocks
1.必要的更新

apt-get update && apt-get upgrade  

debian6下如果更新失败,请添加更新源

2.安装必要组件

apt-get install --no-install-recommends build-essential autoconf libtool libssl-dev gawk debhelper dh-systemd init-system-helpers pkg-config asciidoc xmlto apg libpcre3-dev 
apt-get install gcc
  1. 安装git
    apt-get install git

4.下载shadowsocks-libev源码包并编译

git clone https://github.com/shadowsocks/shadowsocks-libev.git  
cd shadowsocks-libev  
./configure –prefix=/usr/local/sswls
make && make install  

5.安装完成后,配置服务及配置文件:

mkdir -p /etc/shadowsocks-libev
cp ./debian/shadowsocks-libev.init /etc/init.d/shadowsocks-libev
cp ./debian/shadowsocks-libev.default /etc/default/shadowsocks-libev
cp ./debian/config.json /etc/shadowsocks-libev/config.json
chmod +x /etc/init.d/shadowsocks-libev

vi /etc/init.d/shadowsocks-libev
更改BIN目录位置用/usr/local/sswls/bin

6.设置开机自启动:

update-rc.d shadowsocks-libev defaults(debian 5.0)
insserv shadowsocks-libev(debian 6.0)

7.配置shadowsocks配置文件
单用户配置文件sample
修改配置文件命令:

vi /etc/shadowsocks-libev/config.json

修改Server地址和server_port以及加密方式:

Default
{
    "server":"your_server_ip",
    "server_port":8388,
    "local_address":"127.0.0.1",
    "local_port":1080,
    "password":"ilovechina",
    "timeout":300,
    "method":"aes-256-cfb",
    "fast_open": false
}

每一个字段的含义:
Default
server 服务器 IP (IPv4/IPv6),注意这也将是服务端监听的 IP 地址或输入0.0.0.0
server_port 服务器端口
local_port 本地端端口
password 用来加密的密码
timeout 超时时间(秒)
method 加密方法,可选择 "bf-cfb", "aes-256-cfb", "des-cfb", "rc4", 等等。默认是一种不安全的加密,推荐用 "aes-256-cfb"

多用户多端口配置文件 sample

Default
{
    "server":"你服务器IP地址或者0.0.0.0",
    "local_address": "127.0.0.1",
    "local_port":1080,
    "port_password":{
         "9000":"password0",
         "9001":"password1",
         "9002":"password2",
         "9003":"password3",
         "9004":"password4"
    },
    "timeout":300,
    "method":"aes-256-cfb",
    "fast_open": false
}

8.使用命令。

/etc/init.d/shadowsocks-libev stop  #停止
/etc/init.d/shadowsocks-libev start  #启动
/etc/init.d/shadowsocks-libev restart  #重启

标签: none

评论已关闭