You are not logged in.
Whenever I interrupt sudo by pressing ctrl+c during a password prompt, it causes a 2 second delay before printing that a password is required. This is probably the same delay when you enter an incorrect password.
Today I was running a NixOS VM and when I pressed ctrl+c on a password prompt it was interrupted instantly. But when I entered an incorrect password, there was still a 2 second delay. I checked the VM's sudoers file and the sudoers.d configs to see if something was different but there was nothing I could find. sudo-rs also does a similar thing. Also read the friendly manual but there was nothing related I could find.
How do I configure sudo so that it removes the delay when it is interrupted?
Last edited by Everything2067 (2026-03-19 07:09:25)
How it feels to run shred/wipe in a COW system
Offline
Ctrl+c counts as a failed authentication try, so the delay is triggered.
You could compare the pam.d configuration. It is somewhere in there. Beware, that modifying pam might lead to a locked system.
Offline
https://man.archlinux.org/man/faillock.conf.5.en and set "nodelay", also see https://bbs.archlinux.org/viewtopic.php?id=268668
Offline
The faillock.conf solution does exactly what I wanted. Thanks.
How it feels to run shred/wipe in a COW system
Offline