EnvMap GitHub

SSH without stored keys: EnvMap signs a certificate for every session

A privileged access manager that stores every server's password is the most valuable thing on the network to steal. Since 0.7.79 EnvMap can store nothing for an SSH host. Each session gets a fresh key, signed for five minutes, for one login name.

EnvMap is an open-source, self-hosted control plane with a privileged access manager (PAM) in it. People open SSH, RDP and VNC sessions from the browser and never see the password or key, and every session is recorded.

Until 0.7.79 that meant EnvMap kept the credential, sealed in its database, and handed it only to the connection. That keeps it away from people. It does not keep it away from whoever steals the database and the key that seals it. Teleport's answer to that problem is short-lived certificates, and it is the one point where our comparison pages said Teleport was simply better. So EnvMap now does the same for SSH.

All of the code is in the repository, in app/sshca.py and the cert branch of _ssh_auth in app/pam.py.

What happens when somebody connects#

  1. EnvMap makes a new key pair for this session, in the session's own scratch directory. It has never existed before and is deleted when the session ends.
  2. EnvMap signs it with its own SSH certificate authority, for five minutes, for one login name: the target's username.
  3. The certificate names the person. Its key ID is envmap:<their email>:<target>.
  4. ssh connects with that key and certificate. The host accepts it because it trusts the authority, not because it knows the key.

This is a real certificate made by EnvMap's code for a target called web-lb-01, read back with ssh-keygen -L:

text
Type: ssh-ed25519-cert-v01@openssh.com user certificate
Signing CA: ED25519 SHA256:YwqG9MSbpRYX5IqPOxNtnvOGNZt2ID+YJd24YLE50nI (using ssh-ed25519)
Key ID: "envmap:alex@example.com:web-lb-01"
Valid: from 2026-11-29T21:58:38 to 2026-11-29T22:04:38
Principals:
        deploy

It opens one account, deploy, for six minutes: five, plus one minute backdated so a host whose clock runs a little behind does not refuse it.

The Terminal with a live SSH session on web-lb-01, and the SOP panel open on a runbook with its commands
What the person sees is an ordinary SSH session in the browser. The key behind it exists for this session only.

What the host needs#

One line of sshd configuration. The public half of the authority goes in a file, and sshd is told to trust it:

bash
echo 'ssh-ed25519 AAAA… envmap-user-ca' > /etc/ssh/envmap_ca.pub
echo 'TrustedUserCAKeys /etc/ssh/envmap_ca.pub' >> /etc/ssh/sshd_config
systemctl reload sshd

Settings → Privileged Access shows the real public key and these commands. There is no agent to install and no daemon to run on the host. Then the target's credential is set to EnvMap certificate, and the target stores its address and login name and nothing else. The docs have the steps.

Who was it? The host's own log says#

Because the key ID names the person, sshd writes it into its own log beside the login. A sign-in looks like this (the addresses and fingerprints are examples):

text
Accepted publickey for deploy from 10.0.10.5 port 51234 ssh2:
  ED25519-CERT SHA256:vnJi37… ID envmap:alex@example.com:web-lb-01 (serial 0)
  CA ED25519 SHA256:YwqG9M…

With a shared key, the host's log says "deploy" and nothing more, and the question "which of the four people with the key was it?" goes to EnvMap's audit log. With a certificate, the host answers it by itself.

What a stolen database is worth now#

For a target on certificates, the database holds an address and a login name. There is no key that opens the host. A certificate copied out of a running session stops working within minutes.

Said honestly, the risk moves rather than disappearing. The authority's own private key is now what matters, because it can sign a certificate for any host that trusts it. It is one key instead of one per host, and it is sealed like every other credential in EnvMap. The other difference is how a leak is fixed. Changing a leaked password means changing it on every host. A leaked authority is replaced with one button, Replace the authority…, after which the hosts are given the new public key.

Four small things the code had to get right#

What it does not do#

Try it#

The quickest look is the demo, with nothing to install. To run EnvMap as a PAM and nothing else, on one machine:

bash
curl -fsSLO \
  https://raw.githubusercontent.com/ammar-hassoun/envmap/main/deploy/compose/compose.yaml
ENVMAP_MODE=pam docker compose up -d

Then open http://localhost:8471, create the authority in Settings → Privileged Access, and add the line to a test host. More: the PAM page, access requests and the production gate, and how a session recording is built.

EnvMap home · Docs · GitHub