How to Configure OpenHands SSH Permissions
You set up openhands ssh permissions by giving the agent a restricted system user and key. Then you limit what that remote account can read, write, or run on your servers. Many engineering teams start by sharing a personal developer key with their AI agent. That shortcut gives the automated tool broad root rights across every machine on the network. When an agent makes a mistake with a shared key, it can wipe critical files. How openhands ssh permissions work in practice OpenHands runs shell
SSH Access Management + AI Agent Permissions: the complete guide
Architecture patterns, implementation strategies, and security best practices. Delivered to your inbox.
You set up openhands ssh permissions by giving the agent a restricted system user and key. Then you limit what that remote account can read, write, or run on your servers. Many engineering teams start by sharing a personal developer key with their AI agent. That shortcut gives the automated tool broad root rights across every machine on the network. When an agent makes a mistake with a shared key, it can wipe critical files.
How openhands ssh permissions work in practice
OpenHands runs shell commands and edits code inside a local workspace or a remote host. When the agent connects to a remote server over SSH, it uses standard system keys. The remote server checks the public key and maps the session to a local user. From that moment on, the operating system controls what the agent can do.
To lock this down, teams create a dedicated Linux user just for the AI agent. They put the agent public key into the authorized keys file for that specific user. They also remove group memberships that allow admin rights or system changes. Instead of raw static keys, teams can also use OpenSSH certificates for user login. A certificate authority key signs the agent public key and attaches a key identity. The certificate also holds one or more principal user names and a set of options. OpenSSH certificates use a much simpler format than standard web TLS certificates. By setting a short validity window when signing, teams stop old agent keys from working forever.
Why native SSH setup leaves a runtime gap
Dedicated Linux accounts and OpenSSH user certificates solve the initial login problem well. They prove which agent is logging in and block unauthorized accounts at the door. You can also attach certificate options to limit port forwarding or force a single command. These built-in tools work great when a machine only runs one predictable backup script.
Still, an AI software agent needs an open shell to debug issues and run tests. Once the SSH server lets the agent in, native login checks step out of the way. The SSH daemon does not read or judge individual shell commands in flight. If the agent has write permissions to a folder, it can delete that whole folder. If the agent reads a log file with customer emails or phone numbers, it sees everything. Standard OS permissions cannot rewrite sensitive fields like card numbers or national IDs in command output. They also cannot pause a single risky shell command to ask a human for approval.
SSH Access Management + AI Agent Permissions: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
How to tighten agent access on your hosts
Start by separating human admin accounts from automated agent accounts on every host. Never let OpenHands reuse a key that belongs to a human engineer on your team. Create a specific user role on the target host with read-only permissions by default. Only grant write permissions to the exact code folders the agent must change.
Next, replace static public keys with signed OpenSSH user certificates for your agent fleet. Sign each key with your authority key and set a clear key identity string. List the exact allowed user principals so the certificate only works for the agent account. Always set a tight validity window because the default certificate lifetime is forever. Finally, route agent sessions through a bastion host so your team has one clear entry point.
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 OpenHands use a personal developer SSH key?
No, sharing a personal key gives the agent all the same rights as that developer. It also makes server logs confusing because you cannot tell human actions from agent actions.
How do OpenSSH certificates improve openhands ssh permissions?
A certificate authority signs the agent key with an identity, allowed principals, and an expiration time. You do not have to copy and delete static keys across dozens of remote servers.
Can standard SSH permissions block one bad command inside an open shell?
No, standard SSH checks only control the login step or lock the user to one script. Once an interactive shell opens, the local operating system runs any command that user is allowed to run.
Related guides
In this post