Centos 7 安装配置Shadowsocks多用户+BBR加速

  • A+
所属分类:服务器教程

Shadowsocks是当前比较受欢迎的科学上网工具,本文将介绍Centos 7下配置安装Shadowsocks多用户 + BBR加速,Shadowsocks软件下载请访问官网

安装 pip & Shadowsocks

pip是 python 的包管理工具。在本文中将使用 python 版本的 Shadowsocks,此版本的 Shadowsocks 已发布到 pip 上,因此我们需要通过 pip 命令来安装:
yum -y install python-setuptools && easy_install pip && pip install shadowsocks

配置 Shadowsocks

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

vi /etc/shadowsocks.json

写入内容退出并保存:

{
 "server":"0.0.0.0",
 "local_address": "127.0.0.1",
 "local_port":1080,
  "port_password": {
    "8350": "HelloShadowsocks",
    "8351": "HelloShadowsocks",
    "8352": "HelloShadowsocks",
    "8353": "HelloShadowsocks"
 },
 "timeout":300,
 "method":"rc4-md5",
 "fast_open": false
}

说明:

  • "server":"0.0.0.0"里填自己服务器ip
  • method为加密方法,可选aes-128-cfb, aes-192-cfb, aes-256-cfb, bf-cfb, cast5-cfb, des-cfb, rc4-md5, chacha20, salsa20, rc4, table

开机自启动

vi /etc/rc.local

写入内容退出并保存:

ssserver -c /etc/shadowsocks.json -d start

关闭防火墙并禁止开机自启

systemctl stop firewalld.service
systemctl disable firewalld.service

启动、关闭与重启命令

ssserver -c /etc/shadowsocks.json -d start
ssserver -c /etc/shadowsocks.json -d stop
ssserver -c /etc/shadowsocks.json -d restart

安装Google BBR加速

跳转链接

方法二创建脚本安装

新建文件install-shadowsocks.sh:

vi /home/install-shadowsocks.sh

写入内容推出并保存:

#!/bin/bash    
#安装shadowsocks    
yum -y install python-setuptools && easy_install pip && pip install shadowsocks     
#配置多用户    
filename="/etc/shadowsocks.json"
cat>"${filename}"<<EOF
{
 "server":"0.0.0.0",
 "local_address": "127.0.0.1",
 "local_port":1080,
  "port_password": {
    "8351": "hellogoogle",
    "8352": "hellogoogle",
    "8353": "hellogoogle",
    "8354": "hellogoogle"
 },
 "timeout":300,
 "method":"rc4-md5",
 "fast_open": false
}
EOF    
#开机自动启动    
echo "ssserver -c /etc/shadowsocks.json -d start" >> /etc/rc.local    
#启动
ssserver -c /etc/shadowsocks.json -d start   
#关闭防火墙   
systemctl stop firewalld.service #停止firewall    
systemctl disable firewalld.service #禁止firewall开机启动

执行脚本:

sh /home/install-shadowsocks.sh
weinxin
我的微信
这是我的微信扫一扫
SJ

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: