HolyClaude icon indicating copy to clipboard operation
HolyClaude copied to clipboard

Adding SSH and Mosh support

Open ramishi opened this issue 5 months ago • 1 comments

Category

New tool / package

Which variant should this target?

Both

What would you like?

Hi,

I have been running HolyClaude on my home NAS and it works great. I frequently connect to my server from my phone or laptop over a VPN when I am away from home, and I prefer using the terminal CLI directly instead of loading the browser UI, especially when cellular signal is poor or dropping out.

Would you be open to adding native sshd and mosh support to the container?

To keep it secure and lightweight for default users, we can make it completely opt-in. We could add an ENABLE_SSH=true environment variable. If set to true, the entrypoint script would dynamically enable a supervised sshd service via s6-overlay, generate host keys with ssh-keygen -A, and copy an authorized_keys file from the persistent ~/.claude mount directory.

Adding mosh along with it would also solve connection dropout issues on mobile devices because mosh handles IP roaming and cellular dropouts natively.

I have already written and tested this patch locally in a fork. If this sounds like a good fit for the project, let me know and I can open a clean pull request for it.

Thanks!

Use case

mobile

Alternatives considered

No response

ramishi avatar Jul 01 '26 10:07 ramishi

@ramishi thanks for the clear NAS/VPN/mobile use case. This made sense: when you are on a phone, a laptop over VPN, or a weak cellular connection, a direct terminal path can be a lot better than keeping the browser UI open.

This is now merged and released as v1.4.2: https://github.com/CoderLuii/HolyClaude/releases/tag/v1.4.2

What shipped:

  • OpenSSH server and Mosh are installed in both HolyClaude variants.
  • They stay off by default; the quick-start compose exposes no new ports.
  • SSH only starts with HOLYCLAUDE_SSH_ENABLE=true and a separate read-only authorized_keys mount at /run/holyclaude-ssh/authorized_keys.
  • I did not use ~/.claude or /workspace for authorized_keys because those paths are writable runtime/project state. Keeping SSH authorization in a separate read-only mount is safer.
  • SSH login is key-only as claude. Password login, keyboard-interactive login, root login, TCP forwarding, agent forwarding, X11 forwarding, and tunnel forwarding are disabled.
  • Mosh is enabled separately with HOLYCLAUDE_MOSH_ENABLE=true and the documented UDP range, defaulting to 60000-60010.
  • SSH host keys can persist under /var/lib/holyclaude-ssh, so fingerprints survive container recreates when that path is mounted.
  • README, configuration, troubleshooting, architecture, security notes, third-party notices, changelog, Docker Hub description source, memory docs, and translations were updated.

Validation before release: local full and slim images built, SSH/Mosh smoke passed for both, persistence smoke passed for both, compose config passed, and the unit tests passed.

The Docker release workflow is still finishing the full-image publish. The slim publish already succeeded, and Docker Hub tags slim and 1.4.2-slim are live for linux/amd64 and linux/arm64. I’m closing this now because the feature, docs, and v1.4.2 release are in place; the remaining full-image push is the release workflow finishing its registry publication.

Thanks again for offering the local patch and for explaining the real-world connection-dropout problem. That helped shape this into the safer opt-in version that ships now.

CoderLuii avatar Jul 03 '26 05:07 CoderLuii