D
D
Dmitry Surin2017-07-24 12:09:08
linux
Dmitry Surin, 2017-07-24 12:09:08

What does 'sudo -E bash -' do?

What does "sudo -E bash -" mean? For example, in the command - "curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -".
How 'bash -' works. What will he launch?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artyom Belousov, 2017-07-24
@BedwaRe

Runs a script as root, preserving environment variables
Fromman sudo

-E, --preserve-env
Indicates to the security policy that the user wishes to preserve their existing environment vari-
ables. The security policy may return an error if the user does not have permission to preserve the
environment.

Y
Yuri Chudnovsky, 2017-07-24
@Frankenstine

Partial answer: Curl will pull the file and pass it through the pipe to be executed as root.
Full answer: man curl; man sudo; man bash

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question