Skip to main content

sing-box-naive

  1. 下载

    wget -q4O /usr/local/bin/ycycxz-sing-box https://ycycxz.com/dl/ycycxz-sing-box-linux-amd64
    chmod +x /usr/local/bin/ycycxz-sing-box
    mkdir -p /etc/ycycxz-sing-box
    ycycxz-sing-box version
  2. 服务器端配置

    /etc/ycycxz-sing-box/ycycxz.json
    cat <<EOF > /etc/ycycxz-sing-box/ycycxz.json
    {
    "inbounds": [
    {
    "type": "naive",
    "listen_port": 42324,
    "users": [
    {
    "username": "ycycxz",
    "password": "ycycxz"
    }
    ],
    "tls": {
    "enabled": true,
    "acme": {
    "domain": "naive.local",
    "data_directory": "/etc/ycycxz-sing-box"
    }
    }
    }
    ]
    }
    EOF
    tip

    编译 sing-boxtagswith_quic with_acme

  3. systemd

    cat <<EOF > /etc/systemd/system/ycycxz-sing-box.service
    [Unit]
    Description=ycycxz-sing-box
    After=network-online.target

    [Service]
    LimitAS=infinity
    LimitNOFILE=infinity
    LimitNPROC=infinity
    TasksMax=infinity
    ExecStart=/usr/local/bin/ycycxz-sing-box run -c /etc/ycycxz-sing-box/ycycxz.json

    [Install]
    WantedBy=multi-user.target
    EOF
    systemctl daemon-reload
    systemctl enable ycycxz-sing-box
  4. 启动

    danger

    端口80不能被占用

    systemctl start ycycxz-sing-box
    #systemctl status ycycxz-sing-box
    systemctl stop nginx
    systemctl stop caddy
    systemctl stop apache2
    fuser -k 80/tcp
  5. 卸载

    systemctl stop ycycxz-sing-box
    rm /etc/systemd/system/ycycxz-sing-box.service
    systemctl daemon-reload
    rm -rf /etc/ycycxz-sing-box
    rm -f /usr/local/bin/ycycxz-sing-box
  6. 客户端

    Qv2rayquic 或者 https 都可以,padding自适应.

    shadowrocket 报错 NET:ERR_CERT_INVALID

  7. 视频教程