利用Cloudflare tunnel搭建远程web ssh
00 分钟
2023-8-15
2023-8-15
type
status
date
slug
summary
tags
category
icon
password
URL

1.安装cloudflared

  • 打开cloudflare zero trust界面左侧栏的Access- tunnel-create a tunnel
notion image
notion image
  • 选择适合自己操作系统的安装命令安装cloudflared
  • 创建tunnel隧道选择自己喜欢的域名,type选择ssh,url填写内网IP加22端口
notion image

2.搭建远程webssh

  • 回到cloudflare zero trust界面,点击左侧栏的Access-Application-Add an application,选择Self-hosted
notion image
  • 输入你喜欢的名称填写刚才在创建隧道域名,其他保持默认并点击下一步
notion image
  • 添加一个规则,规则名可以随便写,规则配置我选择邮件登录验证,其他保持默认并点击下一步
notion image
  • 添加设置项选择ssh其他不需要填写最后点击Add application即可完成配置
notion image

3.登录web ssh

  • 在浏览器输入刚才创建的cloudflared tunnel地址
notion image
  • 输入在第二步设置的邮箱,填写验证码
notion image
  • 最后填写你的ssh用户名和密码,就可以登录webssh了

4.最后

通过这种方式远程登录自己的服务器,在可以不开放22端口也可以远程操作,同时通过邮箱验证加ssh账号密码的方式认证极大提高了安全性