0%

谷歌云搭建trojan+全平台配置(IOS Mac Android Windows Linux)科学上网

什么是trojan

An unidentifiable mechanism that helps you bypass GFW.

购买vps

在线文本编辑器

切换管理员

  • Linux安装任何软件之前需要切换到管理员模式
    1
    sudo su

更新系统

  • 进入系统后需要更新系统否则,部分软件无法安装
    1
    yum update -y && yum install curl wget unzip -y
    1
    apt update -y && apt install curl wget unzip -y

安装BBRPlus加速

  • 切记Centos 8版本内核暂时无法安装BRRPlus加速,会有无法启动系统的异常
    1
    wget -N --no-check-certificate https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh && chmod +x tcp.sh && ./tcp.sh

安装SSL证书

  • 安装cerbot
    1
    2
    3
    4
    wget https://github.com/certbot/certbot/archive/v1.3.0.zip
    unzip v1.3.0.zip #解压
    cd certbot* #切换到源代码目录
    ./letsencrypt-auto certonly ## 开始安装

使用官方脚本安装trojan

  • 安装cerbot
    1
    bash -c "$(wget -O- https://raw.githubusercontent.com/trojan-gfw/trojan-quickstart/master/trojan-quickstart.sh)"
    1
    bash -c "$(curl -fsSL https://raw.githubusercontent.com/trojan-gfw/trojan-quickstart/master/trojan-quickstart.sh)"
  • 更新trojan配置文件
    trojan配置文件位于:/usr/local/etc/trojan/config.json
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    cat <<EOF >/usr/local/etc/trojan/config.json
    {
    "run_type": "server",
    "local_addr": "0.0.0.0",
    "local_port": 443,
    "remote_addr": "127.0.0.1",
    "remote_port": 80,
    "password": [
    "password1",
    "password2"
    ],
    "log_level": 1,
    "ssl": {
    "cert": "/etc/letsencrypt/live/trojan.duyuanchao.me/fullchain.pem",
    "key": "/etc/letsencrypt/live/trojan.duyuanchao.me/private.key",
    "key_password": "",
    "cipher": "ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384",
    "cipher_tls13": "TLS_AES_128_GCM_SHA256:TLS_CHACHA20_POLY1305_SHA256:TLS_AES_256_GCM_SHA384",
    "prefer_server_cipher": true,
    "alpn": [
    "http/1.1"
    ],
    "alpn_port_override": {
    "h2": 81
    },
    "reuse_session": true,
    "session_ticket": false,
    "session_timeout": 600,
    "plain_http_response": "",
    "curves": "",
    "dhparam": ""
    },
    "tcp": {
    "prefer_ipv4": false,
    "no_delay": true,
    "keep_alive": true,
    "reuse_port": false,
    "fast_open": false,
    "fast_open_qlen": 20
    },
    "mysql": {
    "enabled": false,
    "server_addr": "127.0.0.1",
    "server_port": 3306,
    "database": "trojan",
    "username": "trojan",
    "password": "",
    "cafile": ""
    }
    }
    EOF
  • 查看trojan状态
    1
    systemctl status trojan
  • 启动trojan
    1
    systemctl start trojan
  • 重启trojan
    1
    systemctl restart trojan
  • 开机自启
    1
    systemctl enable trojan

客户端的配置

😄😍😄

欢迎关注我的其它发布渠道