开发者

In hudson job builds, how do i change to other users?

I开发者_JS百科 try using su - user from the execute shell. But it doesn't seen to work.

Any advise?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜