It's all about the answers!

Ask a question

using sudo with agents...


Andy Rutherford (21128) | asked Nov 11 '10, 2:27 a.m.
I have a customer who has the following scenario:

1. The userids used to log into a build machine cannot execute certain commands
2. To execute these commands they must sudo (they've actually written their own version) into another userid with special permissions. However this special userid does not have any login authority and must be sudo-ed into. So the agent would never be able to log in using this ID

In BuildForge terms I'm trying to figure out how to make this work. If I create a Server Authentication for the login id I can get an Agent to login to a Server, but not run the privileged commands.

I could create a step which executed this sudo command forst and then run the privileged commands , but I think I'm right in saying that once the step is finished I'd need to re-issue the sudo command in all subsequent steps to run.

I'd like to be able to login to a Server, sudo into the other userid once, and then run a whole bunch of steps and then exit gracefully.

Any suggestions or comments most welcome
Andy

One answer



permanent link
Brent Ulbricht (2.5k11) | answered Nov 15 '10, 8:52 a.m.
JAZZ DEVELOPER
I have a customer who has the following scenario:

1. The userids used to log into a build machine cannot execute certain commands
2. To execute these commands they must sudo (they've actually written their own version) into another userid with special permissions. However this special userid does not have any login authority and must be sudo-ed into. So the agent would never be able to log in using this ID

In BuildForge terms I'm trying to figure out how to make this work. If I create a Server Authentication for the login id I can get an Agent to login to a Server, but not run the privileged commands.

I could create a step which executed this sudo command forst and then run the privileged commands , but I think I'm right in saying that once the step is finished I'd need to re-issue the sudo command in all subsequent steps to run.

I'd like to be able to login to a Server, sudo into the other userid once, and then run a whole bunch of steps and then exit gracefully.

Any suggestions or comments most welcome
Andy


Hi Andy,

Another angle from an operating system perspective may be to check if their custom version of sudo supports the NOPASSWD tag. This is some information from the Linux man page.


NOPASSWD and PASSWD

By default, sudo requires that a user authenticate him or herself before running a command. This behavior can be modified via the NOPASSWD tag. Like a Runas_Spec, the NOPASSWD tag sets a default for the commands that follow it in the Cmnd_Spec_List. Conversely, the PASSWD tag can be used to reverse things. For example:

ray rushmore = NOPASSWD: /bin/kill, /bin/ls, /usr/bin/lprm

would allow the user ray to run /bin/kill, /bin/ls, and /usr/bin/lprm as root on the machine rushmore as root without authenticating himself.


Brent Ulbricht
Build Forge Test

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.