Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 03-07-2005, 09:50 PM   #1
LQ Newbie
Registered: Sep 2004
Posts: 2

Rep: Reputation: 0
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.

Old 03-07-2005, 10:21 PM   #2
Senior Member
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,265

Rep: Reputation: 369Reputation: 369Reputation: 369Reputation: 369
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Restricting Editing in Sudo (Advanced Sudo Question) LinuxGeek Linux - Software 4 11-04-2006 03:20 PM
sudo mv question howarddevore Linux - General 5 08-16-2005 11:59 AM
Sudo question satimis Fedora 6 11-24-2004 08:58 PM
Sudo question. wbdune Linux - Newbie 2 10-14-2003 12:40 AM
sudo question darthtux Linux - General 1 06-07-2002 02:27 AM

All times are GMT -5. The time now is 05:12 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration