通过Cloudflare实现内网穿透,远程连接内网服务器。

目录

前置条件

一、创建 Cloudflare Zero Trust

二、创建 Tunnel

三、客户机连接服务器


前置条件

  • 持有一个域名并成功托管到 CF(网上有很多免费域名申请教程,找最近发布的教程)

一、创建 Cloudflare Zero Trust

Cloudflare官网https://dash.cloudflare.com/

  • 左侧栏进入 Zero Trust

  • 创建 Zero Trust ,选择免费计划,添加 credit cardPayPal (用于验证,不会扣费,也可通过修改当前页面url跳过支付方式绑定)

二、创建 Tunnel

  • 进入 Zero Trust 后依次点击 -->网络 -->隧道

  • 使用 Cloudflare 创建隧道 

  • 输入隧道名

  • 根据服务器的环境选择对应的下载方式

  • 选择自己托管到 CF 的域名并创建一个子域,服务类型选择 SSH, URL 填写 localhost:22

三、客户机连接服务器

  • 这里假设客户机为 Windows 操作系统,下载对应的 Cloudflare 程序

Downloads · Cloudflare Zero Trust docsCloudflare Tunnel requires the installation of a lightweight server-side daemon, cloudflared, to connect your infrastructure to Cloudflare. If you are creating a tunnel through the dashboard, you can simply copy-paste the installation command shown in the dashboard.https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/downloads/#windows

  •   在 ssh 配置文件中加入以下内容,注意修改 HostName 为实际地址
Host CloudFlare
  HostName example.com
  ProxyCommand C:\Program Files (x86)\cloudflared\cloudflared.exe access ssh --hostname %h

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值