海天无影's Blog

服务器端SSR的配置

/ 1评 / 0

Contents

近期,秋水逸冰删除了自己制作的 Shadowsocksr 一键安装脚本,之前安装 ssr 一直使用这个脚本,很方便,于是记录下脚本,不知道后期是否还能使用。

获取并安装脚本

wget --no-check-certificate -O shadowsocks-all.sh 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

安装完成后,将会提示如下:

Congratulations, your_shadowsocks_version install completed!
Your Server IP        :your_server_ip
Your Server Port      :your_server_port
Your Password         :your_password
Your Encryption Method:your_encryption_method

Your QR Code: (For Shadowsocks Windows, OSX, Android and iOS clients)
 ss://your_encryption_method:your_password@your_server_ip:your_server_port
Your QR Code has been saved as a PNG file path:
 your_path.png

Welcome to visit:https://teddysun.com/486.html
Enjoy it!

SSR管理命令

# 启动、关闭、重启、状态
## Shadowsocks-Python
/etc/init.d/shadowsocks-python start|stop|restart|status
## ShadowsocksR
/etc/init.d/shadowsocks-r start|stop|restart|status
## Shadowsocks-Go
/etc/init.d/shadowsocks-go start|stop|restart|status
## Shadowsocks-libev
/etc/init.d/shadowsocks-libev start|stop|restart|status

# 各版本默认配置文件
## Shadowsocks-Python
/etc/shadowsocks-python/config.json
## ShadowsocksR
/etc/shadowsocks-r/config.json
## Shadowsocks-Go
/etc/shadowsocks-go/config.json
## Shadowsocks-libev
/etc/shadowsocks-libev/config.json

SSR 配置文件详解

## 基本配置
{
    "server": "0.0.0.0",
    "server_port": 8989,
    "password": "password",
    "method": "chacha20",
    "protocol": "origin",
    "protocol_param": "",
    "obfs": "plain",
    "obfs_param": "",
    "timeout": 120,
    "udp_timeout": 60,
    "fast_open": false,
    "workers": 2
}

## 参数说明
{
    "server": "0.0.0.0",    # 监听地址
    "server_port": 8989,    # 监听端口
    "password": "password", # 端口密码
    "method": "chacha20",   # 加密方式
    "protocol": "origin",   # 协议插件, origin: 原版协议
    "protocol_param": "",   # 协议插件参数
    "obfs": "plain",        # 混淆插件, plain: 不混淆
    "obfs_param": "",       # 混淆插件参数
    "timeout": 120,         # tcp超时
    "udp_timeout": 60,      # udp超时
    "fast_open": false,     # 需内核支持(3.7+), 在tcp握手的同时交换数据
    "workers": 2            # worker进程数量
}

## 多用户配置
{
    "server": "0.0.0.0",
    "port_password": {
        "8080": "password1",
        "8181": "password2",
        "8282": "password3"
    },
    "method": "chacha20",
    "protocol": "origin",
    "protocol_param": "",
    "obfs": "plain",
    "obfs_param": "",
    "timeout": 120,
    "udp_timeout": 60,
    "fast_open": false,
    "workers": 2
}

## 多用户 + 不同参数
{
    "server": "0.0.0.0",
    "port_password": {
        "8080": {
            "method": "aes-128-cfb",
            "protocol": "auth_sha1_v4",
            "protocol_param": "",
            "obfs": "tls1.2_ticket_auth",
            "obfs_param": "",
            "password": "password1"
        },
        "8181": {
            "method": "aes-256-cfb",
            "protocol": "auth_aes128_md5",
            "protocol_param": "",
            "obfs": "http_simple",
            "obfs_param": "",
            "password": "password2"
        },
        "8282": {
            "password": "password3"
        }
    },
    "method": "chacha20",
    "protocol": "origin",
    "protocol_param": "",
    "obfs": "plain",
    "obfs_param": "",
    "timeout": 120,
    "udp_timeout": 60,
    "fast_open": false,
    "workers": 2
}

SSR 卸载方法

# 若安装了多个版本,请运行多次(每次卸载一个)
./shadowsocks-all.sh uninstall

SSR 一键安装脚本记录,防止以后脚本被和谐

一条回应:“服务器端SSR的配置”

  1. […] 具体的样式和效果,大家可以点击这篇文章观看:《服务器端SSR的配置》 […]

发表评论

电子邮件地址不会被公开。