Kainé on Nostr: How... can I switch to the root user with sudo in #bash while reading the password ...
How... can I switch to the root user with sudo in #bash while reading the password from a variable?
These don't work:
echo "$sudo_password" | sudo -S su -
# or
echo "$sudo_password" | sudo -S -i
I've also verified that the password (var) being passed should be correct. If I enter the password manually, interactively, the commands work:
sudo su -
# or
sudo -i
These don't work:
echo "$sudo_password" | sudo -S su -
# or
echo "$sudo_password" | sudo -S -i
I've also verified that the password (var) being passed should be correct. If I enter the password manually, interactively, the commands work:
sudo su -
# or
sudo -i