[sudo-users] Running scripts in a networked environment using sudo
govardha at gmail.com
Wed Nov 2 11:49:08 EST 2005
Here's my dilema. I work in a NIS environment where I have a unique
userid(eg jdoe). The production servers have local users for each
production app. As you would expect each production user(eg prdusr)
has specific set of environment variables(a significant #). The local
production user's accounts are locked out. The only way to access the
userid's are to log in as individual users and further "sudo su -
prdusr" in as the production users, at which point I am user "prdusr"
and I have full access to the production environment and all its
Here's my goal:
Setup a single server which is in the NIS environment. All my
monitoring scripts will ssh into the various production servers as the
network user(jdoe) and further run various scripts as user "prdusr"
inheriting the various environment variables.
I can write a script which can force the script to inherit various
defined environment variables, but I would like to avoid it if
possible, as there are a number of different production servers with
uniquely different variables in each box. I can also run scripts in
each production servers as user "prdusr" but it becomes hairy to
manage numerous cron jobs and scripts.
The newer version of sudo has a -i switch which from what I read
allows me inherit user environment variables, but I am not able to get
it to work successfully as of now. Anybody have any suggestions or
thoughts to make this happen.
Thanks in advance.
More information about the sudo-users