利用Cloudflare实现内网穿透访问内部ssh服务器

参考文档:SSH | Cloudflare Zero Trust docs

利用Cloudflare的Zero Trust的Tunnel功能实现内网穿透访问ssh服务器。

具体操作流程可以查找视频网站或者按照上面参考文档的链接给出的指示。

利用Cloudflare实现内网穿透访问内部ssh服务器_第1张图片

----------------

但是如果你已经搭建好了tunnel,无法建立连接的原因是:需要在客户端也安装cloudflared,并配置/.ssh/config:

vim ~/.ssh/config

#在文件中添加
Host ssh.example.com
ProxyCommand /usr/local/bin/cloudflared access ssh --hostname %h

注:如果你是在macOS上用Homebrew安装的cloudflared,路径是/opt/Homebrew/bin/cloudflared。

这在参考文档的第三节中有介绍。
SSH | Cloudflare Zero Trust docsicon-default.png?t=O83Ahttps://developers.cloudflare.com/cloudflare-one/connections/connect-networks/use-cases/ssh/#connect-to-ssh-server-with-cloudflared-access

Cloudflare Tunnel can also route applications through a public hostname, which allows users to connect to the application without the WARP client. This method requires having cloudflared installed on both the server machine and on the client machine, as well as an active zone on Cloudflare. The traffic is proxied over this connection, and the user logs in to the server with their Cloudflare Access credentials.

你可能感兴趣的:(服务器,运维,ssh,网络)