How to Configure Haystack SSH Permissions

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up haystack ssh permissions by pairing a narrow Linux user role with signed OpenSSH certificates. This setup restricts which remote hosts and files your pipeline or engineer can reach. Teams often start by placing a shared private key on the worker node. That quick shortcut gives every pipeline task full shell power on the remote machine. If a prompt or script misbehaves, it can read private files or drop folders. Tighter host rules stop broad user entry before trouble starts. How hays

SSH Access Management + AI Agent Permissions: 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 haystack ssh permissions by pairing a narrow Linux user role with signed OpenSSH certificates. This setup restricts which remote hosts and files your pipeline or engineer can reach. Teams often start by placing a shared private key on the worker node. That quick shortcut gives every pipeline task full shell power on the remote machine. If a prompt or script misbehaves, it can read private files or drop folders. Tighter host rules stop broad user entry before trouble starts.

How haystack ssh permissions work in native OpenSSH

A Haystack pipeline often needs to run remote scripts or fetch data over SSH. In a basic setup, an admin copies a static public key to the host. Static keys never expire on their own, so old keys pile up across servers. A cleaner approach uses an OpenSSH Certification Authority key to sign user keys. OpenSSH added certificate support for users and hosts in version 5.4. An OpenSSH certificate is much simpler than an X.509 certificate used in TLS. It holds a public key, identity info, principal names, and options signed by the CA.

When you sign a key, you set a key identity and list valid principals. Principals are the user or host names that the certificate allows. By default, a signed key makes a user certificate rather than a host certificate. You also set a time window so the certificate expires after a short shift. If you skip the validity setting, the certificate stays valid forever. On the target host, the SSH daemon checks the CA signature and principal name. If both match, the Haystack worker logs in as that specific Linux user.

Why host-level permissions leave a runtime gap

Native SSH rules and OS roles do a great job at the front door. They decide which user or pipeline can open a session on a Linux box. You can also add certificate options to limit port forwarding or force one command. Still, native host rules are all-or-nothing once the shell session starts. If a Haystack agent needs to run three different diagnostic tools, a single forced command breaks.

Teams then fall back to granting a normal shell to a shared service account. Once logged in, the OS cannot tell who triggered a specific pipeline run. The server log only shows that the shared Linux user logged in. It does not check each command in flight or require a human check for risky actions. It also cannot mask sensitive fields like emails, phone numbers, or card numbers in command output. To control individual commands and protect data in flight, you need controls at the command level.

SSH Access Management + AI Agent Permissions: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Best practices for scoping pipeline SSH roles

Start by creating a dedicated Linux user on the remote host for your pipeline. Give that user read or run rights only on the folders it needs. Never add the pipeline user to the sudo group without strict command limits. Next, replace static authorized keys with OpenSSH user certificates signed by your CA. Always set a short validity window when you sign a user key. Record a clear key identity on every certificate so host logs show which service connected. Finally, review your host logs often to spot odd login times or failed principal checks.

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

What is the safest way to grant SSH login to a Haystack worker?

Use an OpenSSH CA to sign a short-lived user certificate for a dedicated Linux account. This avoids leaving static keys on worker nodes and sets a clear expiration time.

How do OpenSSH certificates differ from TLS certificates?

OpenSSH certificates use a much simpler format than X.509 certificates. They bundle a public key, identity text, principal names, and login options signed by an SSH CA key.

Why are Linux user groups not enough for AI pipelines?

Linux groups only check identity at login and apply static file rules. They cannot pause a single risky shell command for human approval or rewrite emails and card numbers in output.

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.