0

We use Hudson as our CI server. My question is it possible to have two jobs, say A and B, so that each runs under different user accounts?

Thanks.

P.S. Hudson runs inside Tomcat on windows server 2003.

mark
  • 691
  • 2
  • 14
  • 31

1 Answers1

1

Unfortunately, no, its not, at least not in the ways you're thinking. If you're running this within Cygwin or similar, you can setup sudo or run a batch script that would allow you to assume another user for the purposes of running a script.

However, as it sounds like you're running this on straight up Windows, you could likely use the runas command to do a similar thing--however, this would require you to place the commands to be run in Hudson as a separate batch script to be run. Also keep in mind that running jobs as users requires that the Tomcat user be able to run as what is likely an administrator, which opens up a whole slew of possible security issues and is NOT recommended.

Andrew M.
  • 10,982
  • 2
  • 34
  • 29
  • Why does Tomcat has to be an administrator? Is it only an admin who can use runas? – mark Mar 25 '11 at 08:30
  • To be honest, I'm not aware of the specifics. The link in my response mentions that this is not the case, but you'll have to setup explicit permissions for the user Tomcat runs as. – Andrew M. Mar 25 '11 at 12:55
  • +1 for the idea to use runas, but I still have to validate this approach to mark your reply as the answer. – mark Mar 27 '11 at 11:34