[sudo-users] Passing environment variables

Paul Pianta ppianta at taleo.com
Tue Dec 19 09:38:29 EST 2006


Hi All
 
With sudo, I am trying to run a script as another user (a non-root user)
but I am having trouble with the environment variables.
 
Here is what I am using in my sudoers file ...
 
Cmnd_Alias ORACLE_CREATE_DB =
/dp00/u02/app/oracle/local/teamdba/tools/scripts/spbuilder/createDatabas
eBuild.sh
rsoft ALL = (oracle) NOPASSWD: ORACLE_CREATE_DB
 
Here are the permissions on the script ...
 
[root at qcdvcn04 rootasp]# ll
/dp00/u02/app/oracle/local/teamdba/tools/scripts/spbuilder/createDatabas
eBuild.sh
-rwxr-xr-x    1 oracle   dba           468 Dec 18 15:40
/dp00/u02/app/oracle/local/teamdba/tools/scripts/spbuilder/createDatabas
eBuild.sh
 
Hopefully what I have in my sudoers file means that the user 'rsoft' can
run the command above, as the user 'oracle' with no password. Ideally, I
would like the environment variables, when running the script, to be
those of the 'oracle' user, rather than the 'rsoft' user.
 
Is there any way to do this?
 
Thanks
 
pantz



More information about the sudo-users mailing list