好的,所以我让Hudson(V1.393)在Ubuntu VM中运行,一切正常。但是,我正在尝试将Mac从属添加到Ubuntu Master中,并且遇到了一些问题。

我已经设置了SSH键,以便从命令行,Ubuntu VM可以使用键在Mac上的名为Hudson的用户中进行SSH。

在Hudson从属配置中,我选择了“通过SSH在Unix机器上启动从属代理”,并输入了主机IP,用户在从服务器上的用户名和Master上的私钥文件的位置(已添加到已添加到从属上的授权密钥文件)。

但是,主人无法连接到从。查看日志(下图),它试图使用密码进行身份验证。

这是基于钥匙的SSH尝试失败的倒退吗?
哈德森是否只是试图使用密码进行身份验证,我需要更改其他内容以使其使用配置中定义的密钥文件?
是否不可能通过Mac上的SSH启动奴隶代理? (我知道这种类型的从属启动方法的名称eprapility状态Unix,但我在思考(阅读:希望)它也可以与OS X一起使用)

日志

[01/14/11 10:38:07] [SSH] Opening SSH connection to 10.0.1.188:22.
[01/14/11 10:38:07] [SSH] Authenticating as hudson/******.
java.io.IOException: Password authentication failed.
at com.trilead.ssh2.auth.AuthenticationManager.authenticatePassword(AuthenticationManager.java:319)
at com.trilead.ssh2.Connection.authenticateWithPassword(Connection.java:314)
at hudson.plugins.sshslaves.SSHLauncher.openConnection(SSHLauncher.java:565)
at hudson.plugins.sshslaves.SSHLauncher.launch(SSHLauncher.java:179)
at hudson.slaves.SlaveComputer$1.call(SlaveComputer.java:184)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)
Caused by: java.io.IOException: Authentication method password not supported by the server at this stage.
at com.trilead.ssh2.auth.AuthenticationManager.authenticatePassword(AuthenticationManager.java:289)
... 9 more
[01/14/11 10:38:07] [SSH] Connection closed.

如果有人在以前设法征服了这种类型的设置,或者有任何提示或想法,我将非常感谢!谢谢

有帮助吗?

解决方案

我最近遇到了同一问题,试图使用SSH在Mac OS X 10.6机器上启动代理。

要获取密码身份验证工作,您需要在客户端节点上编辑 /etc /sshd_config,设置 PasswordAuthentication yes

在Hudson仪表板中,将节点离线访问,请确保配置具有有效的用户名和密码,并启动代理。还要确保 远程FS根 目录由您连接的构建用户所有。

对于无密码的SSH身份验证,请首先检查Hudson Master正在运行的用户。假设这是 tomcat55. 。生成一个公共/私人SSH键对(带有空的密码),然后验证Hudson用户可以连接。

$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/tomcat55/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /home/tomcat55/.ssh/id_rsa.
Your public key has been saved in /home/tomcat55/.ssh/id_rsa.pub.

$ # authorize the hudson master on the hudson node
$ scp /home/tomcat55/.ssh/id_rsa.pub hudson@macnode:~/.ssh/authorized_keys
$ # test the connection
$ ssh -i /home/tomcat55/.ssh/id_rsa hudson@macnode

在Hudson Mac节点上, /etc /sshd_config需要允许无密码访问。

Protocol 2
PubkeyAuthentication yes

在节点配置中,请清除密码字段,并设置私有密钥字段(在此示例中,是/home/tomcat55/.ssh/id_rsa)。您现在应该能够启动代理:

[01/19/11 22:38:44] [SSH] Opening SSH connection to macnode:22.
[01/19/11 22:38:44] [SSH] Authenticating as hudson with /home/tomcat55/.ssh/id_rsa.
[01/19/11 22:38:45] [SSH] Authentication successful.

其他提示

在Ubuntu机器上检查/var/log/auth.log文件。我敢打赌,您需要将Hudson用户的.ssh目录Chmod 700。

我认为第一个答案(选定的答案)是一个很棒的答案,但是我确实发现了它不是唯一解决方案的情况。

就我而言,我有一个正在工作的Mac OS奴隶,然后我把那个Mac倒下了,并提出了一个新的。我以为我只能调整现有节点的配置的设置,以将其指向新的Mac。它不起作用,我在此消息线程中遇到了所有相同的错误和问题。

然后,我进去删除节点,并以完全相同的设置重新创建它,并且起作用。我 嫌疑犯 SSH键指纹更改,并通过删除节点并重新创建它,我可以使其正常工作。不管是什么,导致其失败的关键组件不是配置选项。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top