LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

Rep: Reputation: 0
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
 
Old 03-07-2005, 10:21 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

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


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:38 PM.

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