Hermes Agent SSH: Run Your Agent’s Commands on a Remote Server

Share this post

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 onhermes config set terminal.backend ssh
RequiredTERMINAL_SSH_HOST, TERMINAL_SSH_USER
OptionalTERMINAL_SSH_PORT (22), TERMINAL_SSH_KEY, TERMINAL_SSH_PERSISTENT
Where settings liveHost details in ~/.hermes/.env, backend in config.yaml
AuthSSH 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

  • SSH ControlMaster reuses one connection, with a 5-minute idle keepalive.
  • Hermes connects at startup with StrictHostKeyChecking=accept-new, so a brand-new host is accepted once and checked after that.
  • At startup it snapshots the remote login shell’s environment once.
  • Every later command sources that snapshot, moves to the tracked working directory and runs as a fresh ssh … bash -c.

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.

  • Turn it off with hermes config set terminal.persistent_shell false.
  • For SSH, TERMINAL_SSH_PERSISTENT wins over the config setting.
  • Docker, Modal, Daytona and Vercel Sandbox ignore both settings.

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.

  • The server’s sshd_config needs a matching AcceptEnv line. Without it, the variables are silently dropped.
  • Hermes never forwards its own provider keys, such as OPENAI_API_KEY.
  • SUDO_PASSWORD goes to whichever backend runs the command, so for SSH it’s the remote host’s sudo password.

5. SSH vs Docker, Modal and local

BackendWhere commands runDangerous-command check
localYour own machine, no isolationYes
sshA remote machine you manageYes
dockerOne long-lived local containerNo, the container is the boundary
modalA cloud sandbox VMNo, 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.

  • In Desktop, open Settings → Gateways → Add connection and pick SSH.
  • Enter the host as user@host:22. User and port are optional.
  • The app opens the tunnel, starts the dashboard and connects using your SSH key.
  • Since v0.23.0 (5 Nov 2026), Desktop keeps every gateway connected, so switching to an SSH gateway is instant, and you can open a terminal tab on it.
  • An idle Desktop-owned SSH backend shuts down after 15 minutes with no client and no running turn.

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.

Polar Rank: AI SEO software from Julian Goldie

Get more customers from Google and ChatGPT, without doing the SEO yourself

Polar Rank is a team of AI helpers that work on your website every day. They write new articles and build links to your site, so more people find you on Google and in ChatGPT, and more of them buy from you. One of our own new websites went from 0 to 1,435 Google visitors a day in 7 months.

Try Polar Rank free for 3 daysThen $99 a month, or save 30% with yearly ($69 a month). More traffic in 90 days or your money back.

Table of contents

Related Articles

The best SEO company for plumbers gets your business into Google Maps, local search and AI answers. Compare 10 plumbing SEO companies before you hire.
The best SEO agency for dentists fills chairs from Google and AI search while keeping ads truthful and tracking HIPAA-safe. Compare 10 dental SEO agencies.
The best SEO agency for contractors gets you into Google Maps, local search and AI answers so the phone rings. Compare 10 contractor SEO agencies here.
The best SEO agency for healthcare grows patient bookings while meeting Google’s YMYL bar and HIPAA tracking rules. Compare 10 healthcare SEO agencies.