The sudoers file was fine. The issue was due to the way 'sudo' was used in the script.
sudoers file now is,
Code:
b24adm ALL = (b24prd) NOPASSWD : ALL
Earlier, my script was:
Code:
su - b24prd <<EOF
. /<command1>
. /<command2>
. /<command3>
EOF
In the above, the script used to halt and prompt me for the password for b24prd.
Now, I've included the commands in a separate command.ksh file and use sudo in the script as:
Code:
sudo -u b24prd -i command.ksh