我无法使用'net-ssh'gem通过ssh从ruby连接,获得Net :: SSH :: AuthenticationFailed.代码如下
require 'net/ssh'
keys = ["path_to_private_key"]
Net::SSH.start('host', 'user',:keys => keys, :verbose => :debug) do |ssh|
#ssh code
end
Run Code Online (Sandbox Code Playgroud)
直接从命令行使用ssh工作:
ssh -i <path_to_private_key> user@host
Run Code Online (Sandbox Code Playgroud)
我的ssh API有问题吗?我尝试了'user @ host'和'user'作为用户名,结果相同.
这是调试输出:
D, [2011-07-26T19:42:00.135148 #3511] DEBUG -- net.ssh.transport.session[140b040]: establishing connection to host:22
D, [2011-07-26T19:42:00.164190 #3511] DEBUG -- net.ssh.transport.session[140b040]: connection established
I, [2011-07-26T19:42:00.164344 #3511] INFO -- net.ssh.transport.server_version[140a3fc]: negotiating protocol version
D, [2011-07-26T19:42:00.192092 #3511] DEBUG -- net.ssh.transport.server_version[140a3fc]: remote is `SSH-2.0-OpenSSH_5.3p1 Debian-3ubuntu3'
D, [2011-07-26T19:42:00.192177 #3511] DEBUG -- net.ssh.transport.server_version[140a3fc]: local is `SSH-2.0-Ruby/Net::SSH_2.1.4 x86_64-linux'
D, …Run Code Online (Sandbox Code Playgroud) 我在Ubuntu上安装了Hudson,我正在使用git插件.我作为构建步骤执行的git集成和简单shell脚本似乎工作正常,但是我收到以下错误并且构建失败:
FATAL: null
java.lang.AbstractMethodError
at hudson.model.AbstractBuild.getCulprits(AbstractBuild.java:278)
at hudson.model.AbstractBuild.getCulprits(AbstractBuild.java:275)
at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:565)
at hudson.model.Run.run(Run.java:1386)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:145)
Run Code Online (Sandbox Code Playgroud)
我没有后期构建操作.