傻瓜式安装Shadowsocks服务器

傻瓜式的安装 Shadowsocks 服务器 适用于Linux

命令行模式

  • 单一的Python版本

    1
    2
    3
    wget --no-check-certificate https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks.sh
    chmod a+x shadowsocks.sh
    ./shadowsocks.sh 2>&1 | tee shadowsocks.log
  • 四合一版本

    1
    2
    3
    wget --no-check-certificate https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks-all.sh
    chmod +x shadowsocks-all.sh
    ./shadowsocks-all.sh 2>&1 | tee shadowsocks-all.log
  • 输入密码

  • 输入端口
  • 回车开始安装
  • 添加防火墙

面板模式

  • 创建用户
    • useradd ss
    • su ss
    • cd ~
  • 安装面板

    • wget https://github.com/sendya/shadowsocks-panel/archive/sspanel-v1.2.0.B.tar.gz
    • tar -xvzf sspanel-v1.2.0.B.tar.gz -C ./
    • cd shadowsocks-panel-sspanel-v1.2.0.B/
    • pushd Resource
    • wget https://github.com/sendya/shadowsocks-panel/releases/download/sspanel-v1.2.0.B/Resource.zip
    • unzip Resource.zip
    • popd
    • chmod -R 777 ./Data/
    • cp ./Data/Config.simple.php ./Data/Config.php
    • vi ./Data/Config.php
    • 配置数据库账号密码
    • php -d disable_functions="" index.php install
  • 安装后端

    • git clone https://github.com/Acris/shadowsocks-rm.git
    • cd shadowsocks-rm/shadowsocks
    • yum install m2crypto python-setuptools
    • easy_install pip
    • pip install cymysql
    • 配置数据库账号密码(数据库需要和上面的面板相同)
    • python servers.py

      注意 是 servers.py 不是 server.py

    • 显示 add: {"server_port": xxxx, "password":"xxxxxxxxx", "method":"AES-256-CFB"} 之类的就算成功了
  • 设置开机自启动

    • nano /etc/systemd/system/ss-rm.service

      1
      2
      3
      4
      5
      6
      7
      8
      9
      10
      11
      12
      13
      14
      15
      16
      17
      18
      [Unit]
      Description=Shadowsocks Proxy Services(shadowsocks-rm manyuser)
      After=syslog.target
      After=network.target

      [Service]
      Type=simple
      User=ss
      Group=ss
      WorkingDirectory=/home/ss/shadowsocks-rm/shadowsocks
      ExecStart=/usr/bin/python /home/ss/shadowsocks-rm/shadowsocks/servers.py
      ExecReload=/bin/kill -s HUP $MAINPID
      ExecStop=/bin/kill -s QUIT $MAINPID
      Restart=always
      Environment="USER=ss","HOME=/home/ss/shadowsocks-rm/shadowsocks"

      [Install]
      WantedBy=multi-user.target
    • 设置开机自启 systemctl enable ss-rm

    • 启动服务 systemctl start ss-rm

使用BBR加速服务器网络

  • 安装流程
    1
    2
    3
    wget --no-check-certificate https://github.com/teddysun/across/raw/master/bbr.sh
    chmod +x bbr.sh
    ./bbr.sh

服务器测试脚本

  • 执行 wget -qO- bench.sh | bash 或者 curl -Lso- bench.sh | bash