apt install yubikey-manager libpam-u2f
ykman info
ykman fido info
sudo mkdir -p /etc/Yubico
pamu2fcfg -N | sudo tee -a /etc/Yubico/u2f_keys
See man pamu2fcfg
for more details.
This would enable passwordless authentication using FIDO2 PIN and confirms user's presence.
Perform this only as root, otherwise you may be locked out.
Edit file /etc/pam.d/common-auth
with the following line having precedence over the default pam_unix.so
line:
auth sufficient pam_u2f.so authfile=/etc/Yubico/u2f_keys cue
Open new terminal and test using sudo <cmd>