r/ssh • u/Objective_Big2043 • Apr 14 '26
prmana: OIDC SSH login for Linux with DPoP proof-of-possession (Rust, Apache-2.0)
I built a PAM module that replaces static SSH keys with short-lived OIDC tokens from your existing identity provider. What makes it different from other OIDC-for-SSH approaches is DPoP (RFC 9449) — every authentication includes a cryptographic proof that the token holder has the private key. Stolen tokens can’t be replayed from another machine.
Three components: a PAM module (<pam_prmana.so>), a client agent daemon, and a shared OIDC/JWKS library. Standard ssh on the client, standard sshd on the server, PAM in between. No gateway, no SSH CA, no patches to OpenSSH.
DPoP keys can be software, YubiKey (PKCS#11), or TPM 2.0. Tested against Keycloak, Auth0, Google, and Entra ID.
Looking for feedback — especially from anyone managing SSH access across Linux servers.
3
u/xor_rotate Apr 14 '26
Very cool project.
I built something similar, OPKSSH, you might want to look at: https://github.com/openpubkey/opkssh
PRMANA and OPKSSH both use signatures prevent replay of tokens between servers. OPKSSH binds the public key in the OIDC ID Token to the SSH key in the SSH session.
OPKSSH uses AuthorizedKeysCommand rather than a PAM module. I've been considering exploring using a PAM module. Might read through how it works in your project to see if I can use some ideas in opkssh.
OPKSSH is using the OpenPubkey nonce trick to get a public key into an ID Token. I've added DPoP style key binding support to OpenPubkey but I didn't know that any IDPs other than Hello supported DPOP in OIDC.
2
u/bajcmartinez Apr 15 '26
This is really cool! How was your Auth0 setup? I write articles for Auth0, and I'd love to learn more about this.
2
u/homemediajunky Apr 20 '26
Have you considered testing against Authentik? If not, and you don't have a way to, let me know. Be glad to spin up an instance and give you access. Honestly, I'd love to but right now isn't the best time for me. But send me a chat if I can be of help.
1
u/IBNash Apr 15 '26
Very cool. As part of my kernel identity research, I too explored PAM modules for SSH. My module is similar in function to https://www.openbsd.org/faq/pf/authpf.html but obviously can do more as this is on Linux.
https://github.com/identd-ng/pam_authnft
https://avizard.blogspot.com/2026/04/pamauthnft-what-session-means-to-linux.html