Hermes Agent SSH: Complete Guide (2026)

Julian Goldie — founder, AI Profit Boardroom
By Julian Goldie · 8 min read
Get The AI Profit Stack Join AIPB →
🎯 1,000+ done-for-you AI agent workflows 📅 4 live coaching calls every week 🛡️ 7-day refund + 30-day ROI guarantee 👥 3,400+ AI operators inside

Hermes Agent SSH means pointing the agent's terminal at a remote server: you run hermes config set terminal.backend ssh, put the host and user in your Hermes env file, and every shell command the agent runs from then on executes on that server instead of your laptop.

📺 Watch: Hermes Agent Just Made Multi-Device AI Agents INSANE!

🔥 Get the Agent OS as a free bonus: AI Profit Boardroom members get the full Agent OS zip, prompt libraries, daily tutorials and weekly live coaching calls. → Get inside

This guide covers the exact settings, how the connection works under the hood, what the persistent shell does and doesn't keep, how SSH compares with the Docker, Modal and local backends, and the separate Desktop feature that also uses SSH. Every setting here comes from the official Hermes configuration docs.

Julian Goldie shares his full agent setups, step-by-step trainings and weekly coaching calls inside the AI Profit Boardroom. If you want to talk through your own server plan first, book a free AI strategy session.

What the SSH backend changes

Hermes ships six built-in terminal backends: local, docker, ssh, modal, daytona and vercel_sandbox. Plugins add more, such as Singularity and Sprites.

The backend decides one thing: where the agent's shell commands actually run. With local, they run on the machine Hermes is installed on. With ssh, Hermes stays where it is, but the commands travel to a remote machine you manage.

The Hermes tools page labels the SSH backend "recommended for security", because the agent can't modify its own code. Its files live on one machine and its commands land on another.

One thing the SSH backend is not: a sandbox or a container. It is a real server, and whatever the agent runs there changes that server.

How to set up Hermes Agent SSH, step by step

  1. Pick the server. Any machine you can already reach with an SSH key works. Note the hostname, the user and the port.
  2. Switch the backend. Run hermes config set terminal.backend ssh. In config.yaml the same setting reads terminal, then backend: ssh.
  3. Add the two required variables to ~/.hermes/.env: TERMINAL_SSH_HOST (the docs use my-server.example.com) and TERMINAL_SSH_USER (the docs use ubuntu).
  4. Add the optional ones if you need them. TERMINAL_SSH_PORT defaults to 22. TERMINAL_SSH_KEY is the path to your private key, for example ~/.ssh/id_rsa, and falls back to your system default key.
  5. Start a new session and ask the agent to run hostname. The answer should be the server's name, not your laptop's.

Keep the split clear: the backend choice lives in config.yaml, and the host, user, port and key live in the .env file.

Authentication is key-based. Hermes connects with BatchMode=yes, which means no password prompt, so make sure your key already logs you in without typing anything.

📺 Watch: How to Run Hermes Agent in the Cloud for FREE

How the connection works under the hood

Hermes doesn't open a fresh login for every command. It uses SSH ControlMaster to reuse one connection, with a 5-minute idle keepalive.

At startup it connects with BatchMode=yes and StrictHostKeyChecking=accept-new. The second setting means a host you have never connected to is accepted and remembered the first time.

Right after connecting, Hermes captures the remote login shell's environment once and saves it as a snapshot. From then on, each command runs as a fresh ssh … bash -c that sources the snapshot, moves into the tracked working directory and runs your command.

That design is why the agent sees the same PATH and login exports on every call, even though each call is a new process.

Persistent shell: what carries over between commands

The setting terminal.persistent_shell is on by default. With it on, two things survive from one command to the next: the working directory and exported variables, such as export FOO=bar.

Three things do not survive: plain shell variables, functions and aliases you define mid-session. If a later step needs a value, export it.

To turn the feature off, run hermes config set terminal.persistent_shell false.

For SSH, the order of precedence is TERMINAL_SSH_PERSISTENT first, then terminal.persistent_shell (env name TERMINAL_PERSISTENT_SHELL). The local backend has its own switch, TERMINAL_LOCAL_PERSISTENT. Docker, Modal, Daytona, Vercel Sandbox and plugin backends ignore both.

📺 Watch: How to Run Hermes Agent OS on a VPS

SSH vs Docker, Modal and local

This table follows the backend security comparison in the Hermes security docs and the checkpoint rules in the checkpoints docs:

BackendWhere commands runDangerous-command checkCheckpoints and /rollbackPersistent shell setting
localYour own machine, no isolationYesYesTERMINAL_LOCAL_PERSISTENT
sshA remote machine you manageYesYesTERMINAL_SSH_PERSISTENT
dockerOne long-lived container per Hermes process, via docker execSkipped, the container is the boundaryNoIgnored
modalA cloud sandbox VM with set CPU, memory and diskSkippedNoIgnored

The short version: SSH keeps the safety check and the rollback that local gives you, but moves the work off your machine. Docker and Modal give you a container wall instead, and trade away checkpoints for it.

For maximum isolation, the security docs suggest running the gateway itself on a separate machine or VM.

Planning which backend fits your setup? Book a free AI strategy session and bring your server list.

Skill variables, sudo and the ! shortcut

Skill variables. Variables a skill declares in required_environment_variables, or that you list under terminal.env_passthrough, travel with OpenSSH SendEnv. The values never appear in the command text.

The catch: the server's /etc/ssh/sshd_config needs a matching AcceptEnv line for those names. Without it, the server silently drops them and the remote shell sees them as unset. Hermes provider keys, such as OPENAI_API_KEY, are never forwarded, even if you list them.

Sudo. SUDO_PASSWORD is sent to whichever backend runs the command. On SSH, set it to the remote host's sudo password, not your laptop's.

The ! shortcut. Commands you type with a leading ! in the CLI always run on the machine where Hermes runs, never on the SSH server. So !hostname shows your machine, while the agent's terminal tool shows the server. Path completion in the composer does follow the SSH backend.

Desktop SSH connections are a separate feature

Hermes Desktop can also reach a server over SSH, but it does a different job. The terminal backend sends commands to a server. A Desktop SSH connection drives a whole Hermes install that lives on that server.

To add one, open Settings, Gateways, Add connection, pick the SSH kind and fill the SSH host field as user@host:22. User and port are optional. Your SSH key is used, and the app opens the tunnel, starts the remote dashboard and adopts a token over it.

A Desktop-owned SSH backend stops on its own after dashboard.ssh_isolated_idle_grace_s, which defaults to 900 seconds with no client connected and no turn running.

The v0.23.0 release (5 November 2026) keeps every registered gateway connected, so switching to an SSH gateway is instant. Terminal tabs run on the host they were opened on, with "New terminal on…" for any SSH gateway, and Desktop can now connect to Windows SSH hosts.

After you update Hermes, reconnect Desktop for any SSH backend. Restarting gateways alone doesn't refresh those processes.

For the full picture of running several machines side by side, read the Hermes multi-gateway connections guide.

My verdict on the SSH backend

Use SSH when you want the agent working on a real server, with the dangerous-command check and rollback still in place. It is the right call for a VPS that hosts your sites, a home lab box or a build server.

Use Docker or Modal when you want a throwaway wall around the work and don't need checkpoints. Stay on local only for trusted, hands-on development.

This is the kind of setup Julian walks members through inside the AI Profit Boardroom, and his Agent OS guide shows how the agent, tools and machines fit together. To compare models before you give one a server, check the scores on Goldie Bench. For a one-to-one plan, book a free AI strategy session.

FAQ

How do I get Hermes to run its commands on a remote server?

Run hermes config set terminal.backend ssh, then add TERMINAL_SSH_HOST and TERMINAL_SSH_USER to ~/.hermes/.env and start a new session.

Which key does the SSH backend log in with?

The private key at TERMINAL_SSH_KEY. If you leave it unset, Hermes uses your system default key. The port is 22 unless you set TERMINAL_SSH_PORT.

Will the agent remember my working folder and variables?

With terminal.persistent_shell on, which is the default, the working directory and exported variables carry over. Plain variables, functions and aliases don't.

What separates SSH from the Docker and Modal backends?

SSH runs on a machine you manage and keeps the dangerous-command check and rollback. Docker uses one persistent local container and Modal uses a cloud sandbox, and both skip that check because the container is the boundary.

Can Hermes Desktop open a remote install over SSH?

Yes. Under Settings, Gateways, add an SSH connection in user@host:22 form, and the app opens the tunnel and starts the remote dashboard.

Why are my skill's variables missing on the server?

The server's sshd_config needs an AcceptEnv line for those variable names. Without it, the server drops them without a warning.

Set the backend, add your host and key, run hostname to confirm, and you have a working Hermes Agent SSH setup.

What members say about the AI Profit Boardroom

Read all 114 reviews on Skool →

★ 4.9 out of 5 from 114 member reviews on Skool

Yosuke Sato, AI Profit Boardroom member review (5 stars, paying member for 17 months): The best Skool course you get for AI! I have attended a few Skool courses before, but AI Profit Boardroom is the most active community and has great support from the management team, including Julian! You can get the most up-to-date information and practical implementations in this community. I highly recommend this!Mazzie T, AI Profit Boardroom member review (5 stars, paying member for 10 months): My mind is blown everyday with all the content and the incredible information. So much support and I love the personalised attention and quick responses. The community is great and people are very responsive and helpful.Rene Clayton, AI Profit Boardroom member review (5 stars, paying member for 9 months): The AI Profit Boardroom is a GAME CHANGER people. I could not be more thrilled that I joined!! So much support, more information than you can even consume, a huge value for what the small fee was. I have grown my business, my knowledge and my FUN!. SUCH a fantastic leader and group of humans. I am incredibly honored to be a part of this fantastic group of intelligent humans :-) THANK YOU!Arpiet Malpani, AI Profit Boardroom member review (5 stars, paying member for 8 months): Incredible learning from Julian and team. I started out in march and was able to build end to end SAAS with the help and learning from this group. I am incredibly thankful to Julian for crazy support and prompt response.James Grimm, AI Profit Boardroom member review (5 stars, paying member for 7 months): I asked Julian for help finding local business websites with little to no traffic. Julian was gracious in providing me my personal "how-to" video instruction. Wow, this is the pinnacle of customer service! I am just one of 3,400 subscribers and Julian took the time to help me personally. Thank you Julian for your assistance and outstanding custoemr support and care. James (Jim) GrimmNick Good, AI Profit Boardroom member review (5 stars, paying member for 4 months): I’m part of many AI groups and hands down, what Julian Goldie, has built here…the classroom trainings are amazing, but the community he has created is second to none (the community is worth the cost of joining!). If you’re looking to become the AI expert and build/create something meaningful, then AI Profit Boardroom is for YOU!Steven Gray, AI Profit Boardroom member review (5 stars, paying member for 4 months): Been in awhile. I’m a dad on a factory shift, not a tech bloke. Julian’s lot showed me how to use AI without drowning in tools. Avatar, voice, the workflow thinking — that’s what I needed. If you’re stuck on “where do I start,” this group’s worth it. I always read them.Steve Erickson, AI Profit Boardroom member review (5 stars, paying member for 4 months): I asked Julian a simple question, and he ended up creating a 10-minute video and a guide breaking down in extreme detail what I had asked. Amazing response!Rod Martin, AI Profit Boardroom member review (5 stars, paying member for 3 months): Julian is brilliant, and more prolific than I can keep up with (which is a great thing). His AgentOS is remarkable, and he is THE go-to guy for what you can really do (and not do) with the ever-increasing deluge of new AI upgrades and tools. HIGHLY recommend.Daniel Shulman, AI Profit Boardroom member review (5 stars, paying member for 4 months): Julian is very helpful. He doesn't try sell stuff you dont need and will give you a straight answer to your questions.Rj Herzog, AI Profit Boardroom member review (5 stars, paying member for 5 months): Top notch. If you are searching & searching thinking there is always something better out there.... You just found it. No need to look any further. Goldie covers it all & is super helpful. Can't beat the group either. Really can't recommend this group enough.Jermey Matthews, AI Profit Boardroom member review (5 stars, paying member for 6 months): While he has the capacity to do it, Julian is definitely doing the unscalable things to support his community.

Ready To Join The #1 AI Community?

Join 3,400+ entrepreneurs inside the AI Profit Boardroom. Get the Agent OS, 1,000+ plug-and-play AI agent workflows, daily Q&A with Julian and 4 live coaching calls every week.

Join The AI Profit Boardroom →

7-Day No-Questions Refund • 30-Day ROI Guarantee

← Back to all posts