Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

sshwarm

k9s for ssh. Your Linux machines, their services, containers and logs, in one terminal: what's deployed where, what died overnight, what's crash-looping, and the logs of whatever is red a keypress away.

Quickstart

Install

From
Gogo install github.com/cmdoret/sshwarm@latest
Nixnix run github:cmdoret/sshwarm
Binaryreleases: Linux and macOS, amd64 and arm64
Containersee below

List the machines

In ~/.config/sshwarm/hosts.toml, one [[host]] per machine:

[[host]]
name = "db"                  # ssh db: the rest from ~/.ssh/config

[[host]]
name = "web-1"
host = "web-1.example.org"   # ssh -i ~/.ssh/web deploy@web-1.example.org
user = "deploy"
key  = "~/.ssh/web"

Using deploy-rs? Skip the file: sshwarm --flake ./nix. See configuration.

Run

sshwarm                       # browse
sshwarm status                # print the table, exit 1 on any problem
sshwarm status --format json  # for scripts

The machines need systemd, bash, and ssh without a password prompt. Logs and containers need more: see requirements.

Keys

Key
enteropen
l, dlogs, describe
/filter; in logs, search
:ctr webcontainers of web; :ctr all, of every machine. tab completes
?every key

Container

docker run --rm -it \
  -v ./hosts.toml:/hosts.toml:ro \
  -v ~/.ssh/id_ed25519:/root/.ssh/id_ed25519:ro \
  -v ~/.ssh/known_hosts:/root/.ssh/known_hosts:ro \
  ghcr.io/cmdoret/sshwarm --hosts /hosts.toml

No nix inside, so no --flake. ssh refuses a mounted ~/.ssh/config: the hosts file must set host, user and key.