Using Termux And Cloudflare Tunnel to SSH into My Android Phone
TL;DR Why not Linux VM? Termux is way more reliable for keeping the SSH connection alive and it allows accessing other directories. Introduction In my previous post I talked about using Nix and Home Manager on my Pixel 6A. In this article I’ll share how to use a more “traditional” approach, i.e., using Termux with Cloudflare Tunnel. This is my current setup. Prerequisite Installed Termux, Termux:API and Termux:Boot and turn off battery optimization for them Enabled termux-setup-storage Set up openssh Possess a cloudflare domain for cloudflare tunnel Guide 1. Install cloudflared pkg update && pkg upgrade pkg install cloudflared 2. Configure cloudflared Note ~ is aliased to /data/data/com.termux/files/home Create the dir: cd ~ mkdir .cloudflared cd .cloudflared Set up the tunnel cloudflared tunnel login # follow the on-screen instruction cloudflared tunnel create pixel # create a tunnel called pixel cloudflared tunnel route dns pixel pixel.helloworld.com # create a route (`pixel` is the tunnel name; `helloworld.com` is the domain you own.) You should now have the following files in ~/.cloudflared: ...