I have a simple bash script like this:
#!/usr/bin/env bash
sudo ./some_other_script_01
sudo ./some_other_script_02
When I execute this script, I always see the password prompt, as usual:
[sudo] password for user:
However sometimes, inexplicably, before I have typed my password, ./some_other_script_01
starts getting executed (presumably without root permissions). This happens even though it did prompt me for a password (which I didn't yet provide).
Currently, when this happens, I have to kill the scripts and start again (so that they get executed with root privileges).
sudo
configured withpasswd_timeout
set to some too small value in thesudoers
file?-k
option. Check your man page for details.