2

Hello and sorry for my English in advance.

I need to execute from root command like

envVariable1=15 envVariable2=25 sudo -u user1 sudo -E myCommand

but environment variables don't pass to myCommand. This may look illogical, but it's necessary to run command from root and with sudo cause it will be used in scripts. How can I work around the problem?

1 Answers1

2

I should type var1=1 var2=2 sudo -E -u user1 sudo -E myCommand and then var1 and var2 will be available for user1.

Thanks to AFH to help me to find an answer!