How to set the path of the sudo command?

claudiu
Kilo Explorer

How do you set the path to the sudo command?

I am trying to run discovery on Solaris 10 targets and the sudo command is not in the ServiceNow paths. As far as i could see adding the path_override variable or setting PATH in .profile doesn't work. The command i am trying to run is an ECC one liner.

6 REPLIES 6

It should first set the path, and then it should do must_sudo imho. I was thinking the same what you mentioned in point 6 ie creating s-link. To tighten this, we can allow only srvc_user to x this link. Another thing that you can do is to use complete path instead of relying on must_sudo. But that seems to be lengthy. Also, you are using ksh which is not officially supported. I suggest to change this to bash. Last, set default path to include /usr/local/bin/ in /etc/environment or its equivalent in solaris and export to get immediate results.


Thank you for your suggestions. As always with unix systems there are different ways to get something done.


As for ServiceNow , i hope in the future they will change the behavior of the path_override parameter and the must_sudo parameter so that they will work nicely together.


I did notice in some of my tests that if I remove must_sudo and just add the full path of the sudo command ServiceNow does some weird things and doesn't behave as you would expect, but that can be another thread if i have time to do a full trace of the problem.