Practically everybody uses ssh to login into production machines.
Most people let developers create a key with ssh-keygen, load the key into ssh-agent with ssh-add and then create or distribute .ssh/authorized_keys files – and call it a day.
This is somewhat annoying in the sense that it makes access revocation complicated, makes it necessary to manage developer ssh-keys to enforce secure passwords and so on. You also do not enforce 2FA for key handling, and you'd need to 2FA to each host you login, which is a nuisance.
Developer ssh keys are materialized on disk, contain long lived key material, and are potentially badly protected, leak, and are generally a nuisance.
===
When you login into a host with ssh -A (agent-forwarding) that host can manage the keys in your agent. Specifically, it can also inject keys into your agent. These keys never hit the disk, they are kept in memory, in the agent.
Keys in ssh can also be signed by a CA, and can contain attributes.
One of the attributes is a lifetime – when a signed key expires, it becomes invalid and the ssh-agent simply "forgets" it.
Another set of attributes is a number of signed groups that we can put into the key. They can specify group memberships for the principal (username) in the signed key, and they, like the expiration timestamp, are protected by the signature.
===
Logging into a production host with such a key the sshd will
check the issuing CA and allow the key to proceed only when it is correctly signed.
check the keys lifetime, and will not allow expired keys to proceed.
hand off the certificate and a few other things to an external program that can authorize the key to proceed, for example by comparing the hosts group membership(s) with the set of group memberships in the key. The authz program will either return nothing (denied) or an allowed principal (username). The result: You can only log into hosts of a group you are member of.
===
For the user this means: In the morning, log into the "issuer" ssh.example.com and get a key for the day
$ ssh -A -tt -p 2222 \
-o StrictHostKeyChecking=no \
-o UserKnownHostsFile=/dev/null kris@127.0.0.1
ski
Authenticate with your ski password and TOTP code.
(kris@127.0.0.1) Password:
(kris@127.0.0.1) 2FA:
Key loaded: kris serial=13861769879096579493 valid-until=1787504927
Groups: prod
Connection to 127.0.0.1 closed.
$ ssh-add -l
256 SHA256:RquDquM94ouXwDMCo4uNdWiuGz1nwEzvX7Qmwev80QI ski:kris:SHA256:w6aQ5C02+aexz6g5eULg7TSO1piXyAD90+fy259e5fg:13861769879096579493 (ED25519-CERT)
256 SHA256:RquDquM94ouXwDMCo4uNdWiuGz1nwEzvX7Qmwev80QI ski:kris:SHA256:w6aQ5C02+aexz6g5eULg7TSO1piXyAD90+fy259e5fg:13861769879096579493 (ED25519)
We logged into the issuer, and had to give the issuer a username and a TOTP 2FA number.
We received a key that have us 25 hours of validity, and membership in the group prod.
ssh-add -l lists two entries in the agent: The issuers CA-CERT pubkey, and your ephemeral 25-hour key.
We can use this to ssh kris@prodhost and get into this automatically – no .ssh/authorized_keys needed.
The key also can also contain markers such as "no X11 forwarding" or "no port forwarding". This is a configurable issuer property.
===
https://github.com/isotopp/server-key-injection/ is a demo project that implements this.
It is a demo project, using a local user store instead of integrating with LDAP, Active Directory or OKTA.
It is a demo project, it is written in Python, not in Go or Rust.
Do not use it in production.
The demo project demonstrates two things:
What such an issuer for signed ephemeral certificates and the authz cert checker in a production host can look like.
And what a vibe coding workflow can look like that produces code for such an endavours – because I did not write anything in this codebase but the content of the developer directory.
I started this project a few days ago due to some discussion on the #denog mailing list, and my $20 Codex account with OpenAI was at 100% for its weekly limit (representing a value of $5).
I was not in a particular hurry to complete this project, and just did (sans Epic 6, KRL handling). The account has been mostly used only for this project and is now at 43% of its weekly limit, so approximately 50% of the $5 value of the weekly budget went into this – the implementation has a token cost of $2.50.
The architecture.md was done in Sol/high. The user-stories.md and tickets.md of the epics were done in Terra/medium. The actual code extrusion was done in Luna/xhigh, which is ridiculously cheap after the 80% price reduction in response to the release of Kimi 3.
===
This does work at all because I am using a TDD skill (https://github.com/mattpocock/skills/tree/main/skills/engineering/tdd, copied verbatim into the repo), so during the implementation phase the model is gated by pytest success.
Earlier steps (tickets, user-stories and architecture) have been hand-checked – this is mainly a thing that needed to be done A LOT in the architecture phase, and less so in the user-stories phase of each project. The manual oversight in these phases is what shapes the architecture, threat model, and design decisions.
The tickets and code were mostly read-only, there are no manual edits in the code-base.
===
Code-Generation ("Vibe-Coding") became A LOT better since March this year. With a harness, and a filesystem based workflow as well as regular review steps it is possible to generate viable codebases for non-trivial problems, and keep them on track.
The code may not look like code you would have been writing, but if you were a PO and gave these specs to a team that also would be the case.
Check out the actual codebase, if you like. It's not actually bad code, or bad structure (and it is due to another set of reviews).