setting flags in the sudoers file

Chris Jepeway jepeway at cs.utk.edu
Fri Mar 15 16:53:19 EST 2002


> Hi Chris,
'lo Etienne:

I haven't worked on sudo in years.  The sudo-users at sudo.ws mailing
list is a good place for these sorts of questions.  I've cc'ed
my response there.

> We have a situation where we need to use sudo with the env of the target
> user (i.e. oracle).  Is there a way for us to set this in the sudoers file?
As a total guess, try the -s and -H flags to sudo.

If you've got the user oracle's environment set up properly,
then you could do

	sudo -H -s -u oracle some-oracle-command

and oracle's SHELL will be used.  If that shell is smart
enough to pick up initialization files via $HOME/.*rc, you
should be good to go.

Please, though, don't take this as a definitive solution.
As I said, these days, I'm just a sudo user, one who doesn't
do anything tricky with it.  Perhaps some folk on the list
have certain knowledge as to how to do what you want done.

> Thanks
> Etienne
Chris <jepeway at blasted-heath.com>.



More information about the sudo-users mailing list