How to Configure n8n SSH Credentials

Published
Length
3 min read

Luis Felipe Dias

All posts

To set up n8n ssh credentials, add your server host, user name, and secret to the n8n credential store. Then attach that saved profile to an SSH node or a sub-workflow in your workspace. Many teams start by pasting a shared private key or password into the app. When that remote Linux user has broad root rights, every workflow inherits full control over the host. How n8n ssh credentials work with remote hosts An n8n workflow needs a way to log in to a remote server and run commands. You create

Ephemeral Credentials + 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.

To set up n8n ssh credentials, add your server host, user name, and secret to the n8n credential store. Then attach that saved profile to an SSH node or a sub-workflow in your workspace. Many teams start by pasting a shared private key or password into the app. When that remote Linux user has broad root rights, every workflow inherits full control over the host.

How n8n ssh credentials work with remote hosts

An n8n workflow needs a way to log in to a remote server and run commands. You create a credential profile that holds the target host address, the user name, and the secret. Most admins pick an OpenSSH private key instead of a plain password for this step. The remote server checks the matching public key before it lets the workflow log in.

Some teams use OpenSSH certificates instead of raw static keys to manage host logins. OpenSSH added certificate support in version 5.4 to give teams a simpler option than X.509 certificates. A certificate Authority key signs a user public key along with an identity and valid user names. The remote server trusts the authority key rather than a long list of single user keys.

In n8n, you can also connect workflows to an AI Agent node. The AI Agent node links a chat model to one or more tool sub-nodes. The agent then decides which tool to call to finish a task. A team might link a Call n8n Workflow Tool that runs an SSH node on a server. Once the agent calls that tool, n8n uses the stored profile to open the remote session.

What native SSH setup solves and what it leaves open

A dedicated Linux user and a strong key pair solve the initial login problem. They verify that the network call comes from your n8n instance and not an unknown outsider. You can also limit which folders that Linux user can read or write on the disk. If you use a jump host, you can keep the target server off the public internet.

Still, the native login check only decides who can open a session on the box. It does not inspect or filter the shell commands that run inside that active session. Once n8n logs in, the workflow or AI agent has the full power of that Linux user. A bad prompt or a broken loop in an agent can send a destructive shell command.

Ephemeral Credentials + SSH Access Management: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Shared credentials inside the automation app also make audit logs hard to read. Every workflow that uses the same credential profile looks identical in the server system logs. When ten builders share one n8n profile, the Linux host sees only one generic account name. You cannot tell which person or which workflow ran a specific command at a given time.

How to tighten Linux accounts for automation

Start by creating a separate Linux user on the target host just for n8n tasks. Never give this automation account full root privileges or broad sudo rights across the machine. Grant read or write access only to the exact files and folders the workflow must touch. This limits the damage if a workflow runs an unexpected script or command.

Next, rotate your keys on a regular schedule and remove old keys from the server. If you use OpenSSH certificates, always set a clear expiration window when you sign the key. Keep separate credential profiles in n8n for test servers and production servers. Never let a test workflow share a login profile with a production machine.

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

Should I use a password or a private key for n8n SSH nodes?

You should use an OpenSSH private key or a signed certificate instead of a password. Keys are much harder for attackers to guess and let you turn off password logins on the host.

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

An AI Agent node decides which attached tool sub-nodes to call based on user input. If you attach a workflow tool that contains an SSH node, the agent can trigger those remote commands.

Why is a shared Linux user risky for n8n workflows?

A shared Linux user gives every workflow the same permissions and hides who ran which command. If one workflow fails or gets misused, it can harm any file that the shared user owns.

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.