简介

Trojan 搭建失败?Xtime时光网总结了市面上稳定性最高的一些脚本的功能和安装步骤,欢迎阅读Trojan史上最全的脚本集合!

准备工作

非root用户开启账号及密码登陆

sudo -i
passwd root            //进入root账户,设置root密码
vi /etc/ssh/sshd_config    //修改SSH配置文件,修改完成后保存退出

sshd_config配置文件,修改如下相关内容:

# Authentication:
LoginGraceTime 120 
PermitRootLogin yes    //默认为no,需要开启root用户访问改为yes 
StrictModes yes
 
# Change to no to disable tunnelled clear text passwords
PasswordAuthentication yes

重置完成服务器的重启, 使用SSH客户端登陆, 推荐Finalshell, Xshell等,安装BBR加速

Trojan脚本合集

1. Jrohy的一键Trojan面板脚本 (推荐)

Trojan史上最全的脚本集合
  • 在线web页面和命令行两种方式管理trojan多用户
  • 启动 / 停止 / 重启 trojan 服务端
  • 支持流量统计和流量限制
  • 命令行模式管理, 支持命令补全
  • 集成acme.sh证书申请
  • 生成客户端配置文件
  • 支持trojan://分享链接和二维码分享(二维码仅限web页面)
安装Curl支持环境
apt -y install curl      #Debian
yum -y install curl     #CentOS
#安装/更新
source <(curl -sL https://git.io/trojan-install)
#卸载
source <(curl -sL https://git.io/trojan-install) --remove
trojan
# 常用命令

Usage:
  trojan [flags]
  trojan [command]
 
Available Commands:
  add         添加用户
  completion  自动命令补全(支持bash和zsh)
  del         删除用户
  help        Help about any command
  info        用户信息列表
  restart     重启trojan
  start       启动trojan
  status      查看trojan状态
  stop        停止trojan
  tls         证书安装
  update      更新trojan
  version     显示版本号
  web         以web方式启动
 
Flags:
  -h, --help   help for trojan

2. 官方Trojan脚本

Trojan史上最全的脚本集合

原汁原味的官方味道,适合对于脚本挖矿之说存在顾虑。

安装sudo支持环境
apt install sudo  #debian
yum install sudo  #contos
#安装/更新
sudo bash -c "$(curl -fsSL https://raw.githubusercontent.com/trojan-gfw/trojan-quickstart/master/trojan-quickstart.sh)"

注意事项:官方脚本需要自己设置服务器配置,包括密码、证书等,设置路径为: /usr/local/etc/trojan.config.json

3. Trojan 一键安装脚本

Trojan史上最全的脚本集合

自动获取Trojan官方最新版本进行部署,全智能化

安装wget支持环境
yum -y install wget    //CentOS Yum 安装 wget
apt-get install wget   //Debian Ubuntu 安装 wget
#安装/更新
wget -N --no-check-certificate -q -O trojan_install.sh "https://raw.githubusercontent.com/V2RaySSR/Trojan/master/trojan_install.sh" && chmod +x trojan_install.sh && bash trojan_install.sh

4. Trojan单服务搭建三部曲

Trojan史上最全的脚本集合

分解一键脚本,搭建纯粹的Trojan服务,兼容性高,解决证书出错的问题

# 脚本步骤1
wget -N --no-check-certificate "https://raw.githubusercontent.com/V2RaySSR/Trojansh/master/trojan1.sh" && chmod +x trojan1.sh && ./trojan1.sh
# 脚本步骤2
wget -N --no-check-certificate "https://raw.githubusercontent.com/V2RaySSR/Trojansh/master/trojan2.sh" && chmod +x trojan2.sh && ./trojan2.sh
# 脚本步骤3
wget -N --no-check-certificate "https://raw.githubusercontent.com/V2RaySSR/Trojansh/master/trojan3.sh" && chmod +x trojan3.sh && ./trojan3.sh

配置使用

下载 Trojan Windows/Mac 客户端

安装完成后,会展示一条下载地址,复制地址,并下载下来即可。

Trojan最新客户端下载地址:

搭配 Chrome 浏览器插件使用

Chrome socks5 插件:SwitchyOmega_Chromium 不要解压 直接拖放这个插件到 chrome 扩展程序页面

安装插件,打开 chrome,打开扩展程序,将下载的插件拖动到扩展程序页面,添加到扩展。

Trojan史上最全的脚本集合

完成添加,会跳转到 switchyomega 页面,点跳过教程,然后点击 proxy,如图填写,最后点击应用选项。

Trojan史上最全的脚本集合

然后进入 auto switch,删除最上方两条规则,然后点击添加规则列表。

Trojan史上最全的脚本集合

然后,在规则列表规则中,情景模式改为 proxy,规则列表网站复制下面的网址,然后点击立即更新情景模式,保存即可。

http://{your_domain}/trojan.txt    服务器为你生成的网络地址

Trojan史上最全的脚本集合

点击 chrome 右上角 switchyomega 图标,选择 auto switch 模式即可。

Trojan史上最全的脚本集合
Trojan史上最全的脚本集合

其他软件如何使用 Trojan

  • 如果软件支持配置 socks5,直接指向 127.0.0.1:1080 即可
  • 如果软件不支持配置 socks5,可选择 sstap/sockscap64/supercap 等软件,曲线实现代理

服务端怎么修改密码

trojan 服务端配置文件路径如下,如需修改内容,修改以下文件即可。

/usr/src/trojan/server.conf

修改完成后,重启 trojan 服务端即可,同时客户端的密码也要同步修改哦。

systemctl restart trojan