For example, if I type,
sudo synaptic and enter a wrong password, I get 3 tries to get it right. I want sudo to only give me 1 try and exit with error code 1 if the password is incorrect.
Go to user terminal (not root) and run
Default terminal editor should open.
Add these lines:
## Allow a user to attempt to enter a password 1 times Defaults passwd_tries=1
You should be ok.
PS: About exit code, in my sudo when i run
sudo ls;echo $? , after 3 wrong attempts i get exit code 1.