Answer the question
In order to leave comments, you need to log in
How to pass environment variables when using sudo -u?
Hello.
It is necessary to execute a command like root
envVariable1=15 envVariable2=25 sudo -u user1 sudo -E command
Answer the question
In order to leave comments, you need to log in
The problem is finally solved like this:SOMEVAR=123 sudo -E -u user1 sudo -E command
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question