views:

47

answers:

5

I try using su - user from the execute shell. But it doesn't seen to work.

Any advise?

+2  A: 

It's probably because su is asking for a password interactively. Try setting up sudo so that your hudson user has permissions to run your build command as user without entering a password. See the sudoers manual.


Added: First of all, I'm not completely sure what error you're running into. If you continue to have problems, you should describe what happens in more detail (error messages, log output) and what you've done to try to narrow down the issue.

Second, you can also set up ssh to localhost using a key pair (Google finds lots of examples, here's one).

Instead of su - user, use:

ssh user@localhost cmd

You'll need to create a key pair (without a password) as the hudson user and install the public key in the authorized_keys file of the user you want to log in as.

Finally, you should question whether all this is necessary. Why can't the hudson user run your builds? User-specific setup is a smell.

Dave Bacher
A: 

Hi but i am using Solaris 10 OS. Doesn't seen to have this sudo command.

anyway i am using the solaris console..i type su - user.

It doesn't prompt me for a password and i will be under this account user already.

Any other workaround?

ddd
`sudo` seems to be available for Solaris 10 on the companion software cd: http://www.sun.com/software/solaris/freeware/
Anders Lindahl
Any other options beside using sudo?
ddd
A: 

Is there any other workaround because i am not the owner of the Solaris 10 OS. I can only have access to the Solaris zone.

ddd
Welcome to Stack Overflow! Instead of adding Answers, you should edit your question to provide clarification or additional details.
Dave Bacher
A: 

Any other options beside using sudo?

ddd
A: 
  • ssh user@localhost Pseudo-terminal will not be allocated because stdin is not a terminal.

I encoutered this error when executing in hudson any other ideas?

dfdf

related questions