You are not logged in.

#1 2026-03-17 16:18:56

Everything2067
Member
Registered: 2025-06-29
Posts: 98

[SOLVED]sudo causes a 2 second delay if I press ctrl+c during password

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

#2 2026-03-17 16:28:36

mithrial
Member
Registered: 2017-03-05
Posts: 143

Re: [SOLVED]sudo causes a 2 second delay if I press ctrl+c during password

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

#3 2026-03-17 16:39:20

seth
Member
From: Don't DM me only for attention
Registered: 2012-09-03
Posts: 73,883

Re: [SOLVED]sudo causes a 2 second delay if I press ctrl+c during password

Offline

#4 2026-03-19 07:09:00

Everything2067
Member
Registered: 2025-06-29
Posts: 98

Re: [SOLVED]sudo causes a 2 second delay if I press ctrl+c during password

The faillock.conf solution does exactly what I wanted. Thanks.


How it feels to run shred/wipe in a COW system

Offline

Board footer

Powered by FluxBB