How to Configure Goose SSH Permissions

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up goose ssh permissions by giving the local agent a limited OpenSSH user account and key. You also restrict what that Linux user can run on the remote host. Most teams start by sharing a developer SSH key with the agent on a laptop. That shortcut gives the AI tool broad rights to alter files, restart services, or read secrets. When an automated agent holds full shell rights, one bad prompt can break a live server. How to set up goose ssh permissions with OpenSSH Goose runs shell comm

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 goose ssh permissions by giving the local agent a limited OpenSSH user account and key. You also restrict what that Linux user can run on the remote host. Most teams start by sharing a developer SSH key with the agent on a laptop. That shortcut gives the AI tool broad rights to alter files, restart services, or read secrets. When an automated agent holds full shell rights, one bad prompt can break a live server.

How to set up goose ssh permissions with OpenSSH

Goose runs shell commands on your machine using the local user context. When the agent opens an SSH session, it uses the keys and settings in your local SSH folder. To limit risk, create a dedicated Linux user on the remote host just for the agent. Give that account read rights to log folders and block write rights to system files.

Static SSH keys stay valid until someone removes them from the server. Instead of static keys, teams can use OpenSSH user certificates. OpenSSH added certificate support in version 5.4 using a simpler format than X.509. A Certification Authority key signs the user public key to create the certificate. The signed certificate holds identity text, principal names, and specific certificate options. You also set a validity window when signing so the certificate expires on time. Without a set window, the certificate stays valid forever.

Why host login rules leave a gap in live sessions

OpenSSH certificates and Linux user groups solve the login problem well. They verify who can open a shell on a bastion or target host. They also stop expired keys from logging in without forcing teams to edit server key files.

Still, login checks only run when the session starts. Once the agent opens the shell, the host permits every command that matches the Linux user role. If the agent needs to check app logs, it can also read phone numbers or card numbers inside those logs. If the agent has rights to restart one worker, it might run a destructive script by mistake. Native SSH rules cannot pause a single risky command mid-session for human approval. They also do not rewrite sensitive fields like emails or national IDs in command output before the model reads them.

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

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Steps to harden local agent shell sessions

Start by separating the agent key from your personal workstation key. Store the agent key in a separate path so the tool does not grab your admin credentials. Next, configure the remote host to trust your Certification Authority key and check principal names. Sign the agent key with a short validity window that matches the current task.

On the target Linux machine, remove the agent user from admin groups. Do not allow the agent user to run sudo without a password. If the agent only needs to run one diagnostic script, restrict the certificate or key to that single command. Still, real investigation work often requires flexible shell commands that static command lists cannot cover. Teams need a way to inspect individual commands and mask sensitive output in flight.

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

How does Goose use local SSH keys?

Goose runs commands through your local shell as your current OS user. When it runs an SSH command, the system SSH client reads your local config and loaded keys by default.

Why use OpenSSH certificates instead of standard public keys for an AI agent?

Standard public keys work forever until you delete them from the remote server. OpenSSH certificates let you sign a public key with an identity, principal names, options, and an expiration time.

Can Linux file permissions stop an agent from reading customer data in logs?

No, Linux permissions work at the file level, not the field level. If the agent user can read a log file, it sees all emails, phone numbers, and card numbers inside it.

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.