How to Configure n8n SSH Approval

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up n8n ssh approval by adding a human pause before the SSH step runs. The workflow sends a chat alert and waits for a reviewer to click approve. Teams often let automated workflows or AI agents run shell scripts with broad server keys. When a script has root rights, one bad command can break a live server. Adding a manual check stops bad commands before they touch your Linux hosts. How to build an n8n ssh approval workflow In n8n, an AI Agent node links a chat model to one or more too

Approval Chains & Escalation + SSH Access Management: the complete guide

Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.

Free white paper. No spam. Unsubscribe anytime.

You set up n8n ssh approval by adding a human pause before the SSH step runs. The workflow sends a chat alert and waits for a reviewer to click approve. Teams often let automated workflows or AI agents run shell scripts with broad server keys. When a script has root rights, one bad command can break a live server. Adding a manual check stops bad commands before they touch your Linux hosts.

How to build an n8n ssh approval workflow

In n8n, an AI Agent node links a chat model to one or more tools. The agent picks which tools to call so it can finish a task. You can link a sub-workflow tool that runs remote shell commands over SSH. Without a pause, the agent runs any shell command it writes right away.

To add a gate, split the workflow into a request step and an execution step. First, the agent or trigger builds the shell command it wants to run. Next, the workflow sends that command text to a chat channel or email box. The workflow then pauses and waits for a human response before moving forward.

A reviewer reads the proposed command and clicks an approve or reject link. If the reviewer clicks reject, the workflow stops and logs the refusal. If the reviewer clicks approve, the workflow moves to the SSH step. The SSH step then logs in to the remote host and runs the command.

How OpenSSH keys and certificates work in automated flows

The workflow needs a key or password to log in to the target host. Many teams store a static private key inside the workflow credential store. Anyone who can edit the workflow can use that key on the remote host.

Some teams use OpenSSH certificates instead of static public keys for server logins. A certificate holds a public key, identity info, valid user names, and signed options. A Certification Authority key signs the certificate so the target server trusts it. By default, an OpenSSH certificate lasts forever unless you set a time window. Even with certificates, the workflow still holds a credential that opens a shell session.

Approval Chains & Escalation + SSH Access Management: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What workflow gates solve and what they leave open

A workflow wait step works well for simple, planned automation tasks. It forces a human to look at the task before the workflow continues. It also creates a basic log in your chat app showing who said yes.

Still, workflow-level checks leave several security gaps open on your servers. First, the workflow engine still holds the raw SSH key in its own database. A user who edits the workflow can bypass the wait step and run commands. Second, a workflow check only sees what happens inside that specific workflow canvas. It does not check commands if an engineer or script uses the key outside n8n.

Third, the SSH session itself is not checked once the login succeeds. If the workflow runs a script file on the server, the reviewer only sees the script name. The reviewer does not see the actual commands hidden inside that remote script. Also, if the server output contains customer emails or phone numbers, the workflow reads them in plain text. That raw output goes straight back to the AI chat model or workflow log. Standard SSH logins decide who gets in, not what commands or data move during the session.

Inspect one-shot SSH commands and file tasks

SSH certificates and host rules decide who is allowed on a machine. Setup alone does not check single commands or block sftp reads on sensitive paths. By design, hoop.dev runs an open-source SSH listener on the host where people and agents keep their normal ssh, sftp, and scp tools.

First, hoop.dev guardrails check one-shot commands and file paths before they run. Next, hoop.dev data masking masks matched values in file downloads. The audit trail logs the certificate principal, requested action, and verdict without storing session content. Interactive shells carry no guardrails and can be turned off when every action must be checked. Explore the code on GitHub.

Frequently asked questions

Can an n8n AI Agent run SSH commands on its own?

Yes, an AI Agent node decides which attached tools to call to finish a job. If you attach an SSH workflow tool without a pause, the agent runs commands directly.

Where should the approval step sit in an n8n workflow?

Place the wait and notification step right before the node that opens the SSH session. Pass the exact command string into the message so the reviewer sees what will run.

Why is a static SSH key in n8n a risk?

A static key never expires and stays saved inside the automation tool credential store. Anyone with edit rights in the workspace can attach that key to a new workflow and skip your checks.

Save the open-source gateway.

hoop is MIT-licensed infrastructure for controlling how AI agents reach production data. Star hoophq/hoop so you can inspect it, deploy it, or share it when your team starts governing agent access.