Skip to main content

ttyd

🗎 Refs: Github Repo
  • Quick action

ttyd + Cloudflare Zero Trust + Cloudflare Tunnel

Create dedicated user

Install

Create per-connection tmux wrapper

/home/ttyd/start-tmux.sh

Add tmux auto-cleanup

/home/ttyd/.tmux.conf
  • Restart

Create systemd service

/etc/systemd/system/ttyd.service
  • Apply:
  • Check:
🗎 Refs: Cloudflare Tunnel + GAuth

Install Cloudflare Tunnel

  • Install:
  • Login:
  • Create tunnel
  • Check cloudflared location & tunnel ID
  • Config:
/etc/cloudflared/config.yml
  • Install Cloudflare’s official systemd service and enable:
  • Config DNS: Check Cloudflare’s DNS page -> CNAME rule with the target is TUNNEL_ID.cfargotunnel.com

Setup Zero Trust

Create policy

  • Access controls -> Policies -> Add a policy
  • Input Policy name, Action as Allow, Session Duration as Same as...
  • Add rules Include with Selector is Emails and input whitelisted emails
  • Save policy

Create App Launcher

  • Access controls -> Access settings -> Manage your App Launcher
  • Tab Policies -> Select existing policies -> Choose the created policy
  • Tab Login methods -> Enable PIN
  • Save App Launcher

Create App Launcher

  • Access controls -> Applications -> Add an application
  • Choose Self-hosted, enter Application name, Session Duration
  • Add public hostname, input subdomain configured before
  • Access policies -> Select existing policies -> Choose the policy created before
  • Login methods -> Accept all...

Add Google Auth

  • Integrations -> Identity providers -> Add an identity provider