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

mat*_*son 7 macos ssh hudson master slave

好的,所以我让Hudson(v1.393)在Ubuntu VM中运行,一切正常.但是,我正在尝试将一个Mac奴隶添加到Ubuntu主服务器,我遇到了一些问题.

我已经设置了SSH密钥,因此从命令行,Ubuntu VM可以使用密钥ssh到Mac上的一个名为hudson的用户.

在哈德森从配置,我选择了"通过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.
Run Code Online (Sandbox Code Playgroud)

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

Ron*_*zer 16

我最近遇到了同样的问题,尝试使用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
Run Code Online (Sandbox Code Playgroud)

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

Protocol 2
PubkeyAuthentication yes
Run Code Online (Sandbox Code Playgroud)

在节点配置中清除密码字段,并设置私钥字段(在此示例中为/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.
Run Code Online (Sandbox Code Playgroud)