将Mac Hudson从站连接到Linux主站时,SSH密钥身份验证失败

好吧,所以我让Hudson(v1.393)在Ubuntu VM中运行,一切正常。 但是我正在尝试将一个Mac奴隶添加到Ubuntu主服务器中,我遇到了一些问题。 我已经设置了SSH密钥,因此从命令行,Ubuntu VM可以使用密钥ssh到Mac上的一个名为hudson的用户。 在Hudson slave配置中,我选择了“通过SSH在Unix机器上启动从属代理”并输入了主机IP,从属用户的用户名以及我的私钥文件在主服务器上的位置(已添加到主服务器)奴隶上的授权密钥文件)。 但是,主站无法连接到从站。 查看日志(下面),它正在尝试使用密码进行身份验证。 这是基于密钥的SSH尝试失败的后退吗? Hudson是否只尝试使用密码进行身份验证,我需要更改其他内容以使其使用配置中定义的密钥文件? 是不是可以通过mac上的ssh启动slave代理? (我知道这种类型的奴隶启动方法明确表示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主服务器正在运行的用户。让我们假设这是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文件。我打赌你需要chmod 700 hudson用户的.ssh目录。     
我认为第一个答案(选择的答案)是一个很棒的答案,但我确实找到了一个不是唯一解决方案的案例。 在我的情况下,我有一个Mac OS奴隶正在工作,然后我拿下那台Mac,并提出了一个新的。我想我可以调整现有节点配置的设置,将其指向新的Mac。它没有用,我在整个消息线程中描述了所有相同的错误和问题。 然后我进入并删除了节点并使用完全相同的设置重新创建它并且它工作。我怀疑SSH密钥指纹已更改,通过删除节点并重新创建它,我能够使其正常工作。无论是什么,导致它失败的关键组件都不是配置选项。     

要回复问题请先登录注册