-   Linux - Newbie (
-   -   SUDO question (

sajjad02 03-07-2005 10:50 PM

SUDO question

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

I've configured SUDO, so that user TESTB can run 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/

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


Thanks for your help in advance.


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.