When sudo runs, if you enter a bad password it is cached, and the same bad password is then given to sudo for each subsequent
attempt, so it all falls over.
[sudo] password for candlerb:
Sorry, try again.
[sudo] password for candlerb:
... etc
Possible solutions:
1. Have a sudo_error pattern which wipes the stored sudo_password when seen
2. Only send the stored sudo_password once on each stream; if you see the prompt again, then ask the user for the password
again. (This relies on sudo caching that the password has been seen; timestamp_timeout defaults to 15 minutes)
However it gets messy if the wrong password has been sent to multiple hosts before you realise that it's bad :-(
|