Add: remote Hermes CLI access via SSH and tmux
This commit is contained in:
@@ -0,0 +1,263 @@
|
|||||||
|
---
|
||||||
|
title: Remote Hermes CLI Access via SSH and tmux
|
||||||
|
created: 2026-10-17
|
||||||
|
updated: 2026-10-17
|
||||||
|
type: concept
|
||||||
|
tags: [kb, homelab, ai, tool, workflow, concept]
|
||||||
|
sources: [/opt/data/raw-sources/host-ssh-container-tmux-hermes-tui.md]
|
||||||
|
confidence: medium
|
||||||
|
contested: false
|
||||||
|
---
|
||||||
|
|
||||||
|
# Remote Hermes CLI Access via SSH and tmux
|
||||||
|
|
||||||
|
Run `tmux` on the VPS host, not inside the Hermes container. A host-side session survives SSH disconnects and does not modify an ephemeral container.
|
||||||
|
|
||||||
|
The connection chain is:
|
||||||
|
|
||||||
|
```text
|
||||||
|
home CLI → SSH over Tailscale → host tmux → container exec → Hermes TUI
|
||||||
|
```
|
||||||
|
|
||||||
|
The source environment was verified as follows:
|
||||||
|
|
||||||
|
- Hermes executable: `/opt/hermes/bin/hermes`
|
||||||
|
- State and configuration: `/opt/data`
|
||||||
|
- Container OS: Debian 13
|
||||||
|
- Underlying container runtime: containerd/overlayfs
|
||||||
|
- `tmux` is not installed inside the container
|
||||||
|
|
||||||
|
## 1. Verify Tailscale on the VPS host
|
||||||
|
|
||||||
|
Access the VPS through its provider console or an existing administrative route, then run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
tailscale status
|
||||||
|
tailscale ip -4
|
||||||
|
hostname
|
||||||
|
```
|
||||||
|
|
||||||
|
Record the Tailscale hostname or `100.x.y.z` address.
|
||||||
|
|
||||||
|
If Tailscale is not installed on the host:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -fsSL https://tailscale.com/install.sh | sh
|
||||||
|
sudo tailscale up
|
||||||
|
```
|
||||||
|
|
||||||
|
Follow the authentication URL it prints.
|
||||||
|
|
||||||
|
## 2. Enable SSH access
|
||||||
|
|
||||||
|
### Recommended: Tailscale SSH
|
||||||
|
|
||||||
|
On the VPS host:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo tailscale set --ssh
|
||||||
|
```
|
||||||
|
|
||||||
|
Check the Linux username:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
whoami
|
||||||
|
```
|
||||||
|
|
||||||
|
Connect from a homelab machine:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ssh <username>@<vps-tailscale-hostname>
|
||||||
|
```
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ssh alister@vps-3d0ee869
|
||||||
|
```
|
||||||
|
|
||||||
|
Tailscale SSH access is controlled by the tailnet access policy. If authentication is refused, add or correct the required SSH rule in that policy.
|
||||||
|
|
||||||
|
### Alternative: ordinary OpenSSH over Tailscale
|
||||||
|
|
||||||
|
On a Debian or Ubuntu VPS host:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install -y openssh-server
|
||||||
|
sudo systemctl enable --now ssh
|
||||||
|
```
|
||||||
|
|
||||||
|
Test from home using the Tailscale address:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ssh <username>@100.x.y.z
|
||||||
|
```
|
||||||
|
|
||||||
|
Do not disable the existing VPS access route until the new SSH path works. An incorrect SSH or firewall change can lock you out.
|
||||||
|
|
||||||
|
## 3. Install tmux on the VPS host
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt update
|
||||||
|
sudo apt install -y tmux
|
||||||
|
tmux -V
|
||||||
|
```
|
||||||
|
|
||||||
|
## 4. Identify the Hermes container
|
||||||
|
|
||||||
|
Check Docker first:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo docker ps --format 'table {{.Names}}\t{{.Image}}\t{{.Status}}'
|
||||||
|
```
|
||||||
|
|
||||||
|
Find the container running Hermes, then verify the executable:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo docker exec <container-name> \
|
||||||
|
sh -lc 'test -x /opt/hermes/bin/hermes && echo "Hermes container confirmed"'
|
||||||
|
```
|
||||||
|
|
||||||
|
Verify the data directory and Hermes version:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo docker exec <container-name> \
|
||||||
|
sh -lc 'test -d /opt/data && /opt/hermes/bin/hermes --version'
|
||||||
|
```
|
||||||
|
|
||||||
|
If the host uses `nerdctl` instead of Docker:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo nerdctl ps
|
||||||
|
sudo nerdctl exec <container-name> \
|
||||||
|
sh -lc 'test -x /opt/hermes/bin/hermes && /opt/hermes/bin/hermes --version'
|
||||||
|
```
|
||||||
|
|
||||||
|
If neither command exists, inspect the containerd namespaces:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo ctr namespaces list
|
||||||
|
sudo ctr --namespace default containers list
|
||||||
|
sudo ctr --namespace k8s.io containers list
|
||||||
|
```
|
||||||
|
|
||||||
|
The exact entry command depends on the container manager that owns the container. Docker is the most likely path even when containerd is the underlying runtime.
|
||||||
|
|
||||||
|
## 5. Start a persistent host-side tmux session
|
||||||
|
|
||||||
|
SSH into the VPS:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ssh <username>@<vps-tailscale-hostname>
|
||||||
|
```
|
||||||
|
|
||||||
|
Start a new session or reattach the existing one:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
tmux new-session -A -s hermes
|
||||||
|
```
|
||||||
|
|
||||||
|
Inside `tmux`, enter the container and launch Hermes:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo docker exec -it <container-name> \
|
||||||
|
sh -lc 'cd /opt/data && export HERMES_HOME=/opt/data && exec /opt/hermes/bin/hermes --tui'
|
||||||
|
```
|
||||||
|
|
||||||
|
If the TUI has terminal-rendering problems, pass `TERM` explicitly:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo docker exec -it \
|
||||||
|
-e TERM="$TERM" \
|
||||||
|
-e HERMES_HOME=/opt/data \
|
||||||
|
<container-name> \
|
||||||
|
sh -lc 'cd /opt/data && exec /opt/hermes/bin/hermes --tui'
|
||||||
|
```
|
||||||
|
|
||||||
|
The TUI now uses that Hermes instance's configuration, memory, skills, sessions, and files.
|
||||||
|
|
||||||
|
## 6. Disconnect without stopping Hermes
|
||||||
|
|
||||||
|
Detach from `tmux`:
|
||||||
|
|
||||||
|
```text
|
||||||
|
Ctrl-B, then D
|
||||||
|
```
|
||||||
|
|
||||||
|
The SSH connection can now be closed. The host-side `tmux` session and the container process remain running.
|
||||||
|
|
||||||
|
Reconnect later:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ssh <username>@<vps-tailscale-hostname>
|
||||||
|
tmux attach -t hermes
|
||||||
|
```
|
||||||
|
|
||||||
|
List existing sessions:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
tmux list-sessions
|
||||||
|
```
|
||||||
|
|
||||||
|
## 7. Reduce access to one local command
|
||||||
|
|
||||||
|
On the homelab machine, add this host entry to `~/.ssh/config`:
|
||||||
|
|
||||||
|
```sshconfig
|
||||||
|
Host suzi-vps
|
||||||
|
HostName <vps-tailscale-hostname>
|
||||||
|
User <vps-linux-username>
|
||||||
|
RequestTTY force
|
||||||
|
```
|
||||||
|
|
||||||
|
Test it:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ssh suzi-vps
|
||||||
|
```
|
||||||
|
|
||||||
|
Create a host-side launcher at `/usr/local/bin/hermes-container`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo tee /usr/local/bin/hermes-container >/dev/null <<'EOF'
|
||||||
|
#!/bin/sh
|
||||||
|
exec sudo docker exec -it \
|
||||||
|
-e TERM="${TERM:-xterm-256color}" \
|
||||||
|
-e HERMES_HOME=/opt/data \
|
||||||
|
<container-name> \
|
||||||
|
sh -lc 'cd /opt/data && exec /opt/hermes/bin/hermes --tui'
|
||||||
|
EOF
|
||||||
|
|
||||||
|
sudo chmod 755 /usr/local/bin/hermes-container
|
||||||
|
```
|
||||||
|
|
||||||
|
Replace `<container-name>` before saving the launcher.
|
||||||
|
|
||||||
|
The homelab command can then be:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ssh -t suzi-vps 'tmux new-session -A -s hermes /usr/local/bin/hermes-container'
|
||||||
|
```
|
||||||
|
|
||||||
|
For a shorter invocation, create a local alias:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
alias suzi="ssh -t suzi-vps 'tmux new-session -A -s hermes /usr/local/bin/hermes-container'"
|
||||||
|
```
|
||||||
|
|
||||||
|
Then run:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
suzi
|
||||||
|
```
|
||||||
|
|
||||||
|
## Limitation after a container restart
|
||||||
|
|
||||||
|
If the Hermes container restarts or is recreated, the interactive Hermes process ends. The host `tmux` session may remain, but `/usr/local/bin/hermes-container` must be run again. Ordinary SSH disconnects do not affect the running process.
|
||||||
|
|
||||||
|
## Related
|
||||||
|
|
||||||
|
- [[concepts/hermes-config-loader|Hermes Config Loader]]
|
||||||
|
- [[index|Wiki index]]
|
||||||
|
- [[log|Wiki change log]]
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
> Content catalog for personal-wiki (`https://gitea.maukit.com/hermes/personal-wiki`).
|
> Content catalog for personal-wiki (`https://gitea.maukit.com/hermes/personal-wiki`).
|
||||||
> Local root: `/opt/data/wiki`. Profile: `~/profiles/wiki/` (isolated Hermes agent).
|
> Local root: `/opt/data/wiki`. Profile: `~/profiles/wiki/` (isolated Hermes agent).
|
||||||
> Shared with `floof` (Gitea push access). Read access: public repo clone.
|
> Shared with `floof` (Gitea push access). Read access: public repo clone.
|
||||||
> Last updated: 2026-10-14 | Total pages: 19
|
> Last updated: 2026-10-17 | Total pages: 20
|
||||||
|
|
||||||
## Raw Sources (`raw/`)
|
## Raw Sources (`raw/`)
|
||||||
- `raw/articles/` — web clippings, saved articles
|
- `raw/articles/` — web clippings, saved articles
|
||||||
@@ -32,6 +32,7 @@
|
|||||||
- [[email-hosting|Email Hosting]] — options for hosting email for a custom domain
|
- [[email-hosting|Email Hosting]] — options for hosting email for a custom domain
|
||||||
- [[concepts/fractal-pop-2-vision-fans-not-spinning-asrock-b650m-pro-rs|Fractal Pop 2 Vision Fans Not Spinning on ASRock B650M Pro RS]] — wiring and safe isolation tests for the case's separate 3-pin DC fan motors and 5 V ARGB lighting
|
- [[concepts/fractal-pop-2-vision-fans-not-spinning-asrock-b650m-pro-rs|Fractal Pop 2 Vision Fans Not Spinning on ASRock B650M Pro RS]] — wiring and safe isolation tests for the case's separate 3-pin DC fan motors and 5 V ARGB lighting
|
||||||
- [[concepts/hermes-config-loader|Hermes Config Loader]] — multi-layered config system; YAML hierarchy, alias resolution, fallback providers, secrets handling; from 2026-10-08 config.yaml investigation
|
- [[concepts/hermes-config-loader|Hermes Config Loader]] — multi-layered config system; YAML hierarchy, alias resolution, fallback providers, secrets handling; from 2026-10-08 config.yaml investigation
|
||||||
|
- [[concepts/remote-hermes-cli-access-via-ssh-and-tmux|Remote Hermes CLI Access via SSH and tmux]] — persistent access from a home CLI through Tailscale SSH and host-side tmux into the containerized Hermes TUI
|
||||||
- [[how-to-break-up-with-google-a-practical-step-by-step-migration-guide|How to Break Up with Google: A Practical, Step-by-Step Migration Guide]] — layered de-Google strategy: identity → storage → daily tools → mobile; domain-first; self-hosting email warnings; provider comparisons
|
- [[how-to-break-up-with-google-a-practical-step-by-step-migration-guide|How to Break Up with Google: A Practical, Step-by-Step Migration Guide]] — layered de-Google strategy: identity → storage → daily tools → mobile; domain-first; self-hosting email warnings; provider comparisons
|
||||||
- [[concepts/kindle-repair-code-2-and-jailbreak-recovery|Kindle Repair Code 2 and Jailbreak Recovery]] — PW5 boot-failure triage, safe recovery order, warranty context, and explicit warning that the older serial guide is unverified for PW5
|
- [[concepts/kindle-repair-code-2-and-jailbreak-recovery|Kindle Repair Code 2 and Jailbreak Recovery]] — PW5 boot-failure triage, safe recovery order, warranty context, and explicit warning that the older serial guide is unverified for PW5
|
||||||
- [[moving-domain-email-away-from-google-workspace|Moving Domain Email Away from Google Workspace]] — full migration guide: choosing a host, steps, MX records, canceling Workspace
|
- [[moving-domain-email-away-from-google-workspace|Moving Domain Email Away from Google Workspace]] — full migration guide: choosing a host, steps, MX records, canceling Workspace
|
||||||
|
|||||||
@@ -124,3 +124,11 @@ Appended to log
|
|||||||
- Updated `concepts/future-projects.md` to link the project and remove the false implication that an internally mounted NVMe should be hot-swapped
|
- Updated `concepts/future-projects.md` to link the project and remove the false implication that an internally mounted NVMe should be hot-swapped
|
||||||
- Updated `index.md`; added the new project and restored the existing missing `concepts/switch-diagnostic-prompt.md` entry, with the total reconciled to 19 Layer 2 pages
|
- Updated `index.md`; added the new project and restored the existing missing `concepts/switch-diagnostic-prompt.md` entry, with the total reconciled to 19 Layer 2 pages
|
||||||
- Files created or updated: `concepts/desktop-server-swap-project.md`, `concepts/future-projects.md`, `index.md`, `log.md`
|
- Files created or updated: `concepts/desktop-server-swap-project.md`, `concepts/future-projects.md`, `index.md`, `log.md`
|
||||||
|
|
||||||
|
## [2026-10-17] ingest | Remote Hermes CLI access via SSH and tmux
|
||||||
|
- Concept created: `concepts/remote-hermes-cli-access-via-ssh-and-tmux.md`
|
||||||
|
- Preserved the complete host-side workflow: Tailscale verification and SSH, OpenSSH fallback, tmux installation, Docker/nerdctl/containerd discovery, Hermes TUI launch, detach and reconnect steps, and a single-command launcher
|
||||||
|
- Preserved the lockout warning, terminal-rendering fallback, exact command templates, and the container-restart limitation
|
||||||
|
- Source: `/opt/data/raw-sources/host-ssh-container-tmux-hermes-tui.md`
|
||||||
|
- Index updated; total reconciled to 20 Layer 2 pages
|
||||||
|
- Files created or updated: `concepts/remote-hermes-cli-access-via-ssh-and-tmux.md`, `index.md`, `log.md`
|
||||||
|
|||||||
Reference in New Issue
Block a user