Trojan搭建教程

Trojan搭建教程

我在搭建时候遇到最大的问题就是镜像源,我这个是在centos7上面安装的,rocky7应该通用,别的需要换对应的源。
第一次update用下面的镜像源
sudo vi /etc/yum.repos.d/CentOS-Base.repo,写入如下内容

# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
#
 
[base]
name=CentOS-$releasever - Base
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=https://mirrors.ustc.edu.cn/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
 
#released updates
[updates]
name=CentOS-$releasever - Updates
# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=https://mirrors.ustc.edu.cn/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
 
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=https://mirrors.ustc.edu.cn/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
 
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
# mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
baseurl=https://mirrors.ustc.edu.cn/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

更新源

centos操作系统:

yum update -y && yum install curl -y

ubuntu操作系统:

apt-get update -y && apt-get install curl -y

输入一键安装脚本

source <(curl -sL https://git.io/trojan-install)

跟着安装脚本做完。
trojan安装完成,提示重启trojan成功后,选择证书方式:Let’s Encrypt证书,输入注册的域名(需要dns解析到该主机ip)。

以上都做完以后如果不能访问https,那就是证书还有问题,需要更换镜像源。
下载源
1、安装wget
yum install -y wget
2、下载CentOS 7的repo文件

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

或者

curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

3、更新镜像源
清除缓存:yum clean all
生成缓存:yum makecache

这个时候再输入trojan命令,选择第三个安装管理,再选择第二个证书申请,再次选择Let’s Encrypt 证书,这时候输入你的域名,更新完毕后就可以使用https了。

  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
finalshell是一款非常强大的服务器管理工具,可以通过它来搭建Trojan代理。具体步骤如下: 1. 首先需要购买一个VPS,可以选择国内的阿里云、腾讯云等,也可以选择国外的DigitalOcean、Vultr等。需要注意的是,需要选择一个支持安装FinalShell的操作系统。 2. 安装FinalShell客户端,并连接到VPS。在FinalShell中,选择“工具箱”->“协议”->“Trojan”,点击“安装Trojan”按钮,按照提示安装Trojan。 3. 配置Trojan服务器。在FinalShell中,选择“工具箱”->“协议”->“Trojan”,点击“编辑配置文件”按钮,在弹出的编辑器中输入Trojan服务器的配置信息。配置信息格式如下: { "run_type": "server", "local_addr": "0.0.0.0", "local_port": 1080, "remote_addr": "127.0.0.1", "remote_port": 8000, "password": [ "your_password" ], "log_level": 1 } 其中,“local_port”是本地监听端口,“remote_port”是远程端口,“password”是用于加密传输的密码。 4. 启动Trojan服务器。在FinalShell中,选择“工具箱”->“协议”->“Trojan”,点击“启动服务”按钮,即可启动Trojan服务器。 5. 配置客户端。在客户端电脑上安装Trojan客户端,并配置连接信息。连接信息格式如下: { "run_type": "client", "local_addr": "127.0.0.1", "local_port": 1080, "remote_addr": "your_server_ip", "remote_port": 8000, "password": [ "your_password" ], "log_level": 1 } 其中,“remote_addr”是你的服务器IP地址,“password”是你在服务器上设置的密码。 以上就是使用FinalShell搭建Trojan代理的步骤。如果还有任何问题,欢迎继续咨询。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值