Two-factor authentication adds a second proof of identity to a password or SSH key: possession of a physical security key, such as a FIDO U2F or FIDO2/WebAuthn authenticator, checked by a PAM (Pluggable Authentication Modules) rule on the target machine. pam_u2f is Yubico's PAM module for that job: it validates a challenge–response against a public credential registered to the user, with no shared secret stored on the server.
Reemote is a pure-Python configuration-management library. Instead of a domain-specific language, you write an ordinary Python generator that yields operations, gather typed facts from the target, and await a two-phase run that previews the work before applying it. This article uses Reemote's pam_u2f module to install the package, write its global configuration, synchronize a centralized credential file, and require a key for sudo and SSH logins.…