If I'm asked for the sudo password, after typing it in correctly, the terminal moves on almost instantaneously. However, if I mistype my password, it takes a few seconds before working it out and asking me again. I timed it a few times, and mostly takes around 2.2 seconds.Why does it take so much longer, and is there a way to speed it up?(I have a few dodgy keys on my mechanical keyboard that often don't register, or register twice, so I often mistype my password.)
Why is sudo slow when I mistype my password?
terminal;sudo
The built-in delay is to slow down the process of password guessing. Looks like someone could programmatically guess about 27 potential passwords per minute, which, as you've observed is a good deal less than if there was no delay.