Hello all,
I have a script (script.sh) that is owned and executed by root. Now I need to give another user (user1) sudo access to execute that script.
I edited the /etc/sudoers file, and created the following:
My question is: How can I make it so when user1 runs the script, it uses the same environmental variables as root?
I read about this option: Defaults env_keep, but in this case I don't know exactly how many environmental variables I need to keep.
Is there any way that I can keep all the environmental variables of root when user1 uses sudo to execute the script?
Thank you!
I have a script (script.sh) that is owned and executed by root. Now I need to give another user (user1) sudo access to execute that script.
I edited the /etc/sudoers file, and created the following:
Code:
# Runas alias specification
Runas_Alias RO = root
user1 ALL=(RO) NOPASSWD: /usr/bin/script.sh
I read about this option: Defaults env_keep, but in this case I don't know exactly how many environmental variables I need to keep.
Is there any way that I can keep all the environmental variables of root when user1 uses sudo to execute the script?
Thank you!