利用国外服务器搭建ss

时间:2023-11-15 18:03:14
  1. wget --no-check-certificate  https://raw.githubusercontent.com/teddysun/*_install/master/*.sh
  2. chmod +x *.sh
  3. ./*.sh 2>&1 | tee *.log
  4. 中间会提示你输入你的SS SERVER的账号,和端口。不输入就是默认。跑完命令后会出来你的SS客户端的信息。
    利用国外服务器搭建ss

    利用国外服务器搭建ss
    利用国外服务器搭建ss
  5. 安装完成后,脚本提示如下:
    Congratulations, * install completed!
    Your Server IP:your_server_ip
    Your Server Port:your_server_port
    Your Password:your_password
    Your Local IP:127.0.0.1
    Your Local Port:1080
    Your Encryption Method:aes-256-cfb
    win客户端下载:在github网站上https://github.com/*/*-windows/releases
    利用国外服务器搭建ss

    Server配置

    SS安装以后需要进行配置,SS使用JSON格式文件进行配置,配置文件路径和名字可以自己决定,一般放在:

    /etc/*.json

    格式如下:

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

    解释如下:

    Name Explanation
    server 你VPS的IP地址,IPV4,IPV6都可以
    server_port 提供SS服务的端口号,写自己想用的端口号
    local_address the address your local listens
    local_port local port
    password 传输数据时用来加密的密钥,和Client相同
    timeout 连接超时时间
    method 加密方法 推荐使用 “aes-256-cfb”
    fast_open use TCP_FASTOPEN, true / false
    workers number of workers, available on Unix/Linux

    多用户配置

    使用port_password,每个用户对应一个端口,然后后面是密码。如果想搭建一个用户管理系统,参见:Manager API.

    {
        "server": "0.0.0.0",
        "port_password": {
            "8381": "foobar1",
            "8382": "foobar2",
            "8383": "foobar3",
            "8384": "foobar4"
        },
        "timeout": 300,
        "method": "aes-256-cfb"
    }

    启动和停止

    前台运行命令:

    ssserver -c /etc/*.json

    后台运行命令:

    ssserver -c /etc/*.json -d start
    ssserver -c /etc/*.json -d stop