I use Ansible to manage my infrastructure and utilize randomized passwords (which I do not track). To access the machine I have GPG hardware security tokens (Yubikey 5 NFC) that can SSH into the machines as root. Recently I bodged a network config and found out the hard way that having disk encryption and no local root password it a major PITA (I did manage to get access again though).
The question originates from this incident; is there a way to locally login to a Linux (Debian) system using a hardware GPG token? I'd rather not have to keep track of root passwords for all the servers that I manage and instead only rely on the hardware tokens for which I already have a management process in place.
I have heard of pam-ssh-agent modules, but I have yet to make it work with gpg-agent.
Any thoughts are appreciated!