I want to do sudo -i within a bash script but also want to pass in the sudo username and password at the same time. Is that possible?
sudo -i
i.e. something like:
echo PASSWORD | sudo -k -S -i -u USERNAME