Hermes Agent SSH lets your agent run its shell commands on a remote server you own, instead of on your laptop. You switch one setting, add a host and a key, and every command the agent runs happens on that machine. Here’s the exact setup from the Hermes docs, how the persistent shell works, and when SSH beats Docker or Modal.

Key takeaways

  • One setting: hermes config set terminal.backend ssh.
  • Needs TERMINAL_SSH_HOST and TERMINAL_SSH_USER in ~/.hermes/.env.
  • Key auth only. Port defaults to 22.
  • Keeps the dangerous-command check, unlike container backends.
  • Want an agent set up on your own server for your business? Get your Backlink Gameplan, or try Polar Rank free for 3 days.

What the Hermes Agent SSH backend is

Hermes ships six built-in terminal backends: local, docker, ssh, modal, daytona and vercel_sandbox. According to the configuration docs, the backend decides where the agent’s shell commands actually run. Pick ssh and they run on a remote server.

Hermes SSH at a glance
Switch it on hermes config set terminal.backend ssh
Required TERMINAL_SSH_HOST, TERMINAL_SSH_USER
Optional TERMINAL_SSH_PORT (22), TERMINAL_SSH_KEY, TERMINAL_SSH_PERSISTENT
Where settings live Host details in ~/.hermes/.env, backend in config.yaml
Auth SSH key (your system default if none is set)

1. Set it up in three steps

hermes config set terminal.backend ssh

# ~/.hermes/.env
TERMINAL_SSH_HOST=my-server.example.com
TERMINAL_SSH_USER=ubuntu
TERMINAL_SSH_KEY=~/.ssh/id_rsa   # optional
TERMINAL_SSH_PORT=22            # optional

In config.yaml the same choice reads terminal: backend: ssh. The SSH backend section lists only key authentication, so set up a key on the server first. Hermes connects with BatchMode=yes, which means it never stops to ask for a password.

Want your AI agent running safely on its own server? Inside the AI Profit Boardroom you get the Agent OS — Hermes, OpenClaw, OpenCode, Claude and Codex in one place — plus step-by-step Hermes training and four live coaching calls a week.

Want a plan for your business first? Get your Backlink Gameplan, or try Polar Rank free for 3 days.

Join the AI Profit Boardroom →Get Your Backlink Gameplan →Try Polar Rank Free for 3 Days →

2. How the connection works

The result feels like one long session on the server, without holding a fragile interactive shell open.

3. The persistent shell

terminal.persistent_shell is on by default. With it on, the working directory and exported variables (export FOO=bar) carry over between commands. Plain shell variables, functions and aliases you define mid-session don’t.

Source: the persistent shell docs.

4. Passing secrets to the server safely

If a skill needs environment variables, list them in terminal.env_passthrough or let the skill declare them. Hermes forwards them with OpenSSH SendEnv, so the values never appear in the command text.

Want this set up for you instead of doing it yourself? Get your Backlink Gameplan → or try Polar Rank free for 3 days →

Get Your Backlink Gameplan →Try Polar Rank Free for 3 Days →

5. SSH vs Docker, Modal and local

Backend Where commands run Dangerous-command check
local Your own machine, no isolation Yes
ssh A remote machine you manage Yes
docker One long-lived local container No, the container is the boundary
modal A cloud sandbox VM No, the container is the boundary

The security docs recommend SSH because the agent can’t modify its own code on the host. Checkpoints and /rollback also work on SSH and local, but not on container backends (source). One catch: ! commands you type in the CLI always run where Hermes runs, not on the server.

6. Hermes Desktop over SSH

This is a separate feature. terminal.backend ssh moves the agent’s commands. A Desktop SSH connection drives a whole Hermes install on another machine.

Details are in the multi-connection Desktop docs and the v0.23.0 release notes. After a Hermes update, reconnect Desktop so the SSH backend restarts.

My verdict

If your agent touches anything important, give it its own server. Set the backend to SSH, use a dedicated user and key, add AcceptEnv for the variables your skills need, and keep the persistent shell on. Hermes Agent SSH is the simplest way to keep the agent off your own laptop without losing the safety checks.

About Julian Goldie

I’m Julian Goldie — founder of Goldie Agency and the AI Profit Boardroom. I test new AI agents almost every day for 432K+ YouTube subscribers and run Hermes, OpenClaw, OpenCode, Claude and Codex side by side in my own Agent OS. Get your Backlink Gameplan, try Polar Rank free for 3 days, or join the AI Profit Boardroom.

Want another angle? Read the AI Profit Boardroom guide to the Hermes Agent SSH backend.

FAQ: hermes agent ssh

How do I make Hermes Agent run commands over SSH?

Run hermes config set terminal.backend ssh, then set TERMINAL_SSH_HOST and TERMINAL_SSH_USER in ~/.hermes/.env.

Which SSH key does Hermes Agent use?

The key at TERMINAL_SSH_KEY. If that isn’t set, it uses your system default key. The port defaults to 22.

Can Hermes Agent log in to SSH with a password?

Only key authentication is documented, and Hermes connects with BatchMode=yes, so it never prompts for a password.

Does the shell remember my state between commands?

Yes, with terminal.persistent_shell on, which is the default. The working directory and exported variables carry over. Plain variables, functions and aliases don’t.

How is the SSH backend different from Docker or Modal?

SSH runs on a remote machine you own and keeps Hermes’s dangerous-command check. Docker and Modal run in a container or cloud sandbox and skip that check because the container is the boundary.

Why aren’t my skill’s environment variables reaching the server?

The remote sshd_config needs an AcceptEnv line for those variable names. Without it, the server silently drops them.

Ready to put Hermes to work in your business? Join the AI Profit Boardroom for the Agent OS, setup training and daily updates.

Or get your Backlink Gameplan and we’ll map out your setup, or try Polar Rank free for 3 days.

Starting from zero? Get the free AI course and community.

Join the AI Profit Boardroom →Get Your Backlink Gameplan →Try Polar Rank Free for 3 Days →Get the FREE AI Course + Community →

Related reading

Last updated November 2026. This page is a living guide to hermes agent ssh — the facts here move fast and it is updated as they do.

Leave a Reply

Your email address will not be published. Required fields are marked *