Skip to content

feat(infra): SSH-over-Cloudflare-Tunnel setup for cloud environments - #20

Merged
SomeRandmGuyy merged 1 commit into
mainfrom
claude/cloud-env-ssh-setup-yfv6ef
Sep 6, 2026
Merged

SomeRandmGuyy merged 1 commit into
mainfrom
claude/cloud-env-ssh-setup-yfv6ef

Conversation

@SomeRandmGuyy

Copy link
Copy Markdown
Contributor

Summary

Anthropic-hosted cloud environments only allow outbound HTTP/HTTPS through a security proxy, so ssh root@<server> cannot work directly from a cloud session. This adds a Cloudflare Tunnel based route that carries SSH over HTTPS/WebSocket, gated by a Cloudflare Access service token.

Changes

  • infra/ssh-tunnel/server-setup.sh: one-shot root script for the server. Installs cloudflared as a service, appends a dedicated public key to authorized_keys, enables key-only root login, optional password-auth disable.
  • infra/ssh-tunnel/cloud-env-setup.sh: cloud environment setup script. Installs cloudflared only, so no secret lands in the cached filesystem snapshot.
  • infra/ssh-tunnel/session-init.sh: builds ~/.ssh config each session from environment variables (private key, Access service token, pinned host key) and adds an auction-server host alias.
  • .claude/settings.json: SessionStart hook that runs session-init.sh only in cloud sessions.
  • infra/ssh-tunnel/README.md: dashboard steps, Custom allowlist entries, environment variables, troubleshooting.

Testing

  • bash -n on all scripts and JSON validation of the settings file.
  • Not end-to-end tested: the tunnel client could not be downloaded from this session, and the Cloudflare-side setup (domain, tunnel, Access policy) is manual. First run through the README will verify cloudflared access ssh through the session proxy.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RMUkAjWYUX1CFQAe76zgEJ


Generated by Claude Code

Anthropic-hosted cloud sessions only egress over HTTP/HTTPS through a
security proxy, so direct SSH to the auction server is impossible. Add:

- infra/ssh-tunnel/server-setup.sh: one-shot root script that installs
  cloudflared as a service, authorises a dedicated key, and enables
  key-only root login (optional password-auth disable).
- infra/ssh-tunnel/cloud-env-setup.sh: environment setup script that
  installs cloudflared without writing any secret into the cache.
- infra/ssh-tunnel/session-init.sh: builds ~/.ssh config from env vars
  (key, Access service token, pinned host key) each session.
- .claude/settings.json: SessionStart hook running session-init.sh in
  cloud sessions only.
- infra/ssh-tunnel/README.md: dashboard steps, allowlist, env vars.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RMUkAjWYUX1CFQAe76zgEJ
@vercel

vercel Bot commented Sep 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
auctioning Ready Ready Preview Sep 6, 2026 4:40pm UTC

Request Review

@SomeRandmGuyy
SomeRandmGuyy marked this pull request as ready for review September 6, 2026 17:27
@SomeRandmGuyy
SomeRandmGuyy merged commit 5ca5fc7 into main Sep 6, 2026
14 checks passed

This branch was successfully deployed

1 active deployment
Preview — 7fb4f2d4 Deployed Sep 6, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant