LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   SUDO question (https://www.linuxquestions.org/questions/linux-newbie-8/sudo-question-298959/)

sajjad02 03-07-2005 10:50 PM

SUDO question
 
Hi,

I am looking for some help with sudo. I have a script process.sh owned by user TESTA and permission 744. process.sh needs TESTA's environment variables set in .bash_profile for successful run.

I've configured SUDO, so that user TESTB can run process.sh and pick up environment settings of TESTA. But it's not picking up the env variables, in other words, it's not executing TESTA's profile at runtime. How can I make it execute the profile before running the script? I am running this as TESTB: sudo -u TESTA /home/TESTA/process.sh

Host_Alias SVR = linux1
User_Alias ADMIN = TESTB
Cmnd_Alias SCRIPTS = /home/TESTA/process.sh

ADMIN SVR = (TESTA) SCRIPTS

Thanks for your help in advance.

SA

btmiller 03-07-2005 11:21 PM

You could always have the script source TESTA's shell initialization files. It's probably a good idea to put any initialization into the script itself for security reasons (to keep people from changing the script's behavior by modifying the values of environment variables and so on). This will also have the benefit of solving your problem.


All times are GMT -5. The time now is 01:27 PM.