Air Gapped SFTP
You set up air gapped sftp by running an OpenSSH server inside an isolated network. Then you restrict accounts to file transfers and sign user keys with a local authority. Many teams start by copying static public keys onto every isolated host. They often share one admin account across the whole team to move patches and logs. When permissions are that broad, any user with the key can run shell commands. They can also read or overwrite files across the whole host. How air gapped sftp works with
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
You set up air gapped sftp by running an OpenSSH server inside an isolated network. Then you restrict accounts to file transfers and sign user keys with a local authority. Many teams start by copying static public keys onto every isolated host. They often share one admin account across the whole team to move patches and logs. When permissions are that broad, any user with the key can run shell commands. They can also read or overwrite files across the whole host.
How air gapped sftp works with OpenSSH
An isolated network has no route to the outside internet. To move files in or out, operators log in through a hardened relay host host. They can also bring files into an entry zone on physical media first. From that entry zone, they start an SFTP session to the target server.
Relying on static keys across dozens of offline servers creates a big key rotation burden. Instead, teams can use OpenSSH certificates, which arrived in OpenSSH 5.4. These certificates use a much simpler format than standard TLS certificates. An admin uses a Certification Authority key to sign a user public key. The signed certificate holds the public key, an identity string, and allowed principal names. It also holds a set of options that control the session.
In an offline setup, the internal CA lives on a locked-down signing machine. When an engineer needs to move a file, the CA signs their public key. The admin sets a short validity window on the certificate. If you do not set a validity window, the certificate stays valid forever. The target server only needs to trust the single CA public key. It does not need a fresh list of individual user keys.
Next, the server locks the account down to file transfer duties only. The server config forces the built-in SFTP subsystem to run when that user logs in. It also locks the user into a specific directory tree. And it turns off port forwarding and terminal allocation for that session.
What native OpenSSH controls solve and what they miss
Certificate signing and directory locks solve the basic login problem in isolated networks. You no longer push authorized key files to every offline host by hand. Expiring certificates stop old keys from working days after a maintenance window ends. Locking the user into the SFTP subsystem stops them from opening an interactive shell.
Gapped SFTP: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Still, native server settings only decide who can log in and which folder they see. They do not inspect what happens inside the file transfer session in real time. Once a user logs in to a shared folder, the server permits every file action. The user can pull down sensitive archives or overwrite critical app bundles.
Standard server logs also leave gaps for security teams. The host logs the login event and can log file paths if verbose flags are on. Yet those logs sit locally on the isolated host unless you build a log pipeline. If an operator shares a role with three peers, you see the shared principal name. You must cross-check CA signing logs with host logs to see who moved a file. You also cannot require a peer to approve a single high-risk upload in flight.
Add command and file guardrails to SSH access
Host firewalls and certificate principals control who opens an SSH session. Yet an allowed user or agent can still run a bad one-shot command or pull sensitive files over sftp. In practice, hoop.dev sits inline on the host as an open-source SSH server with guardrails that uses OpenSSH certificates. For every one-shot command or sftp task an agent or human runs in production, hoop.dev decides to pass, mask, block, or escalate it for review.
Using hoop.dev SSH controls, guardrails check one-shot commands, env variable names, and sftp or scp paths before they run. Port forwards default to deny unless the target is listed. Because interactive shells have no statement boundary and carry no guardrails, teams can turn them off so every command is checked and logged. Check out the MIT-licensed project on GitHub.
Frequently asked questions
Why use OpenSSH certificates instead of static keys on offline servers?
Static keys stay on the target host until someone deletes them by hand. In an isolated network, updating key files across many servers takes a lot of manual work. With OpenSSH certificates, each server trusts one CA public key. You issue short-lived user certificates that expire on their own without touching the target hosts.
How do you stop SFTP users from getting a shell?
You configure the OpenSSH server to force the internal SFTP command for that user or group. You also disable terminal allocation and network forwarding in the server rules or certificate options. Even if the user tries to start a shell, the server runs only the file transfer process.
What do native SFTP logs miss during an audit?
By default, OpenSSH records when a user logs in and closes a session. You have to turn on extra logging levels on the SFTP subsystem to record file names. Even then, the logs stay on the local disk and do not inspect file contents for sensitive fields like card numbers or national IDs.
Related guides
In this post