Files
IT-Docs/Trojan完整安装教程.md
T

85 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Trojan完整安装教程
## 基本信息
你的信息
域名:osaka.hayashiei.top
IP64.176.55.223
密码:Hayashi2026
端口:443
## 一、重装系统后第一步:放行端口(必须最先做)
运行
ufw allow 80/tcp
ufw allow 443/tcp
ufw reload
## 二、申请 SSL 证书(必须放行端口后再做)
运行
apt update && apt install certbot -y
运行
certbot certonly --standalone -d osaka.hayashiei.top --email test@example.com --agree-tos --no-eff-email
出现成功提示即可继续。
## 三、安装 Nginx(伪装网站用)
运行
apt install nginx -y
systemctl stop nginx
## 四、安装 Trojan
运行
bash <(curl -sL https://raw.githubusercontent.com/trojan-gfw/trojan-quickstart/master/trojan-quickstart.sh)
##五、写入最终配置
运行
```
cat > /usr/local/etc/trojan/config.json << 'EOF'
{
"run_type": "server",
"local_addr": "0.0.0.0",
"local_port": 443,
"remote_addr": "127.0.0.1",
"remote_port": 80,
"password": [
"Hayashi2026"
],
"ssl": {
"cert": "/etc/letsencrypt/live/osaka.hayashiei.top/fullchain.pem",
"key": "/etc/letsencrypt/live/osaka.hayashiei.top/privkey.pem",
"alpn": [
"h2",
"http/1.1"
],
"reuse_session": true,
"session_ticket": false
},
"tcp": {
"no_delay": true,
"keep_alive": true
}
}
EOF
```
## 六、启动 Trojan
运行
systemctl enable trojan
systemctl restart trojan
## 七、客户端连接配置
连接信息
类型:Trojan
服务器:osaka.hayashiei.top
端口:443
密码:Hayashi2026
TLS:开启
跳过证书校验:关闭
支持的客户端
WindowsTrojan-Qt5
AndroidIgniter
iOSShadowrocket、Trojan
## 八、验证是否运行成功
运行
systemctl status trojan
出现 active (running) 就是成功。