1752797 Members
5583 Online
108789 Solutions
New Discussion юеВ

Re: sudo or pbrun

 
kashifr
Advisor

sudo or pbrun

Hi,
I want to add some script which can be executed, whenever user use sudo or pbrun.
6 REPLIES 6
Elmar P. Kolkman
Honored Contributor

Re: sudo or pbrun

From the default sudo I see one solution: define your script as the mailer program.
Every problem has at least one solution. Only some solutions are harder to find.
kashifr
Advisor

Re: sudo or pbrun

could you please guide a little more
IT_2007
Honored Contributor

Re: sudo or pbrun

you can use pbrun also:

pbrun hostname -c "scrpit"

kashifr
Advisor

Re: sudo or pbrun

Ok, when you login root using sudo, from where it set the environment (means which profile is being used for root).
spex
Honored Contributor

Re: sudo or pbrun

Hello,

Rename the sudo and pbrun binaries, then create wrapper scripts named 'sudo' and 'pbrun' to call the renamed binaries. The command you'd like to execute should go in these wrapper scripts.

PCS
kashifr
Advisor

Re: sudo or pbrun

is there any other solution than changing binary name and wrap scripts..?