r/ssh • • 7d ago

I built pixel-ssh-agent: hardware-backed Android SSH agent with BiometricPrompt for the Pixel Linux Terminal (AVF Debian VM)

Post image

Google's built-in Pixel Linux Terminal (a Debian VM running via Android Virtualization Framework / AVF) makes a Pixel surprisingly capable for real ssh, git, and ops work — but I didn't want to store plaintext private SSH keys inside the VM disk image.

So I built pixel-ssh-agent (Kotlin/Compose Android app + zero-C-dependency Rust bridge, MIT license):

How it works

  • Private keys stay on Android: The Debian VM never sees private key material.
  • Hardware-backed & imported keys:

    • ecdsa-sha2-nistp256 generated directly inside Android Keystore / StrongBox.
    • ssh-ed25519 (RFC 8032, deterministic) with seeds envelope-encrypted via an Android Keystore AES-256-GCM master key — including import of existing OpenSSH private keys (bcrypt_pbkdf + aes256-ctr / aes256-gcm@openssh.com).
  • Biometric approval on every sign (or timed window): Uses Android BiometricPrompt with configurable unlock windows (Every sign, 1m, 5m, 15m, 30m), live countdown, instant Lock Now, and locked-screen wakeup (wakes the Pixel for approval without exposing keys/settings behind the lockscreen).
  • Authenticated encrypted tunnel (PSA1) over AVF port forwarding:

    • AVF maps forwarded guest ports strictly to 127.0.0.1 on Android. Since other Android apps with INTERNET permission share loopback, the tunnel enforces mutual authentication and forward secrecy via ephemeral X25519 + 256-bit paired PSK + HKDF-SHA256 + directional AES-256-GCM with multiplexed channels.
  • Drop-in ssh-agent CLI in Debian (pixel-ssh-agent-bridge):

    • Supports eval "$(pixel-ssh-agent-bridge)", -k, -D, print-env, and systemd --user — exposing a standard 0600 SSH_AUTH_SOCK for ssh, git, scp, ssh-add -L, and even agent-forwarding workflows.
    • Bonus: also works on non-Pixel Android devices using Termux (just bind 127.0.0.1 instead of 0.0.0.0).
    • Also pairs nicely with my earlier tool ssh-agent-crypt to unlock SOPS/age keys biometrically on the phone using deterministic Ed25519 signatures.

Security caveat (full transparency)

This is an early MVP (0.1.0). While ECDSA P-256 runs inside Android Keystore / StrongBox, the pure-Kotlin Ed25519 and X25519 implementations currently use BigInteger (not constant-time) — all details and the threat model are documented in SECURITY.md and docs/PROTOCOL.md.

Repo: https://github.com/moses70/pixel-ssh-agent

Feedback, threat-model critique, and ideas (like session-bind@openssh.com or native Android 13+ JCA Ed25519/X25519) are very welcome!

2 Upvotes

0 comments sorted by