Ubuntu – Escape timeout for, or cancel sudo fingerprint authentication and revert to password

authenticationcommand linepasswordsudo

In systems where the fingerprint scanner works, you can enable sudo authentication in the terminal, so that you can swipe your finger instead of typing your password when you issue "sudo" in terminal.

You can enable this by enabling "Fingerprint authentication" on pam-auth-update (by issuing "sudo pam-auth-update").

This works fine, although it is now always convenient to move your hand from the keyboard to the fingerprint scanner when typing. But it works as expected.

The problem starts when the laptop is docked or otherwise with the lid closed with external keyboard and the fingerprint scanner unreachable.

What happens is that when you type a sudo command, it prompts you to scan your finger, which of course you cannot, so you have to wait for the prompt to time out.

And here is the question. Is there a way to escape the timeout so that you can type the password right away? So, for instance you type the sudo command, you get the prompt, hit Esc, prompt goes, then you type the password.

Waiting for that prompt to time out is really annoying, whether you type on the laptop and you don't want to move your hand to the scanner, or when you type on an external keyboard and have no access to the scanner.

Thank you.

P.S. Currently I have to enable/disable it from pam-auth-update every time I change from dock to lap.

Best Answer

I have the same problem, the only ""solution"" I've found is the following:

  • run a sudo command
  • when prompted for fingerprint, stop the fingerprint foreground check with ctrl+z
  • rerun the sudo command (arrow up and enter works fine)
  • it should now be "hanging" without any output
  • immediately cancel with ctrl+c
  • the command should now skip directly at the password input

Here is a screenshot of what it looks like:

process screenshot

It's still a bit annoying but at least you don't have to wait for anything to happen on its own. Hopefully, somebody will come out with a more elegant solution.

Related Question