How to Configure n8n SSH Read Only Access

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up n8n ssh read only access by making a restricted Linux user. Then you bind that user to an SSH key or certificate. Many teams give n8n a shared admin account to move fast. That broad role lets a workflow change files or stop services by mistake. When an AI agent runs commands, broad permissions create even bigger risks. How to set up native n8n ssh read only access N8n connects to remote hosts through its built-in SSH node. An n8n AI Agent node can also call sub-workflows to run rem

Auditor Read-Only Access + 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 read only access by making a restricted Linux user. Then you bind that user to an SSH key or certificate. Many teams give n8n a shared admin account to move fast. That broad role lets a workflow change files or stop services by mistake. When an AI agent runs commands, broad permissions create even bigger risks.

How to set up native n8n ssh read only access

N8n connects to remote hosts through its built-in SSH node. An n8n AI Agent node can also call sub-workflows to run remote commands. The AI Agent node links a chat model with one or more tools. The agent then decides which tool to call to finish its task. When an agent or workflow runs an SSH task, n8n logs in as one user.

N8n itself does not have a setting to make SSH sessions read only. You must enforce read only rules on the target Linux host instead. First, create a dedicated Linux user on the remote server for n8n. Do not add this user to admin groups or grant root rights. Give the account read permissions only on the log folders it must check.

Next, set up key login so n8n does not use a static password. You can use standard SSH keys or OpenSSH user certificates for login. OpenSSH certificates hold a public key, identity info, principal names, and signed options. A certificate authority key signs the user key to make the certificate. OpenSSH added this simpler certificate format in version 5.4 for users and hosts.

You can also lock down what commands the n8n key is allowed to run. In the server authorized keys file, you can attach a forced command option. You can also bake a forced command option right into an OpenSSH certificate. When n8n logs in, the host runs only that preset script or command. Even if an n8n workflow sends a delete command, the server ignores it.

What native Linux and OpenSSH controls solve

A dedicated Linux account stops n8n from writing to system files and folders. Standard file permissions block the workflow from changing app code or server settings. If someone steals the n8n key, the attacker only gets read permissions. Using OpenSSH certificates also helps teams avoid keys that never expire. When you sign a key, you can set a clear time window.

Forced commands add another strong layer for fixed, single-purpose tasks. If n8n only checks disk space, a forced command works very well. The server runs the disk check script and closes the session right away. This setup keeps simple automation jobs from doing harm on the host.

Auditor Read-Only Access + SSH Access Management: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Where host-level SSH rules fall short for workflows and agents

Host rules decide who can log in, not what ad-hoc commands do in flight. Many teams use n8n to check live issues across dozens of servers. A single forced command cannot handle ten different read checks in one workflow. Teams then build a wrapper script that parses arguments on the remote host. One small bug in that script can let a write command slip through.

File permissions on Linux also allow broad reading across the whole disk. Most system files are world-readable by default on a standard Linux setup. A read only user can still read files that hold emails or phone numbers. It can also read local files that store card numbers or national IDs. Native SSH gives you no way to mask those fields in command output.

Managing local users and authorized keys across many servers takes a lot of work. Every time a workflow needs a new read check, an admin must edit scripts. Standard host logs also struggle to link a shell command to an n8n user. You see the shared n8n account in the log, not the person who triggered it.

Check SSH commands and file transfers on the host

OpenSSH keys and certificates decide who can log into a Linux host. They do not check what a one-shot command or file transfer does once the session starts. With hoop.dev, you run an open-source SSH server with guardrails on the host. It checks callers with OpenSSH certificates and works with ssh, sftp, scp, and rsync clients.

When a caller runs a one-shot command or moves a file, hoop.dev guardrails check the command or path before it runs. Then hoop.dev data masking masks matched sensitive patterns in downloads and output. Interactive shells carry no guardrails because keystrokes have no statement boundary. Teams can turn interactive shells off and allow only commands and file tasks. The audit trail logs who connected and what was allowed or refused, without storing keystrokes or file bytes. See the source on GitHub.

Frequently asked questions

Does the n8n SSH node have a built-in read only toggle?

No, the n8n SSH node just sends commands over a standard SSH session. You must set up read only limits on the target server or network path.

How can an n8n AI agent run SSH commands safely?

An n8n AI Agent node uses connected tool sub-nodes or workflows to act. Keep the agent safe by limiting which commands reach the host and checking every run.

Why are Linux file permissions not enough for read only SSH?

Linux gives new accounts read rights to many system and app files by default. Without output filtering, a workflow can pull sensitive data like emails or card numbers.

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.