Is there a way to run sudo -E bash -
without the sudo
command?
I have the command curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash -
that I want to run inside an Ubuntu container where no sudo
exists. By running it with Docker though I provide the Docker parameter -u root:sudo
so that everything inside executes as root.
The command sudo -E bash -
fails though, because sudo
does not exist. Is there a way to just run -E bash -
?
The
-E
is an option of thesudo
command, not a part of the actual command you are running with elevated privileges.From
man sudo
:So as you don't use
sudo
at all, the environment will not be modified anyway. You don't need to replace this option with anything. Just(Btw. the trailing
-
argument afterbash
has no effect, you can omit that too.)Whether it is advisable regarding security to directly run unverified code fetched from an online source as root is another question though...