What is Nostr?
Kainé /
npub1dh7…30fk
2024-07-03 19:56:32

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
Author Public Key
npub1dh7988skt6ew0u6pgyauk7erfx7mdj0g3cfpk053wgn9musz297s7e30fk