【发布时间】:2013-05-03 18:57:58
【问题描述】:
我正在使用 Rye ruby gem 通过 SSH 连接到服务器,但我遇到了一个问题,如果我尝试从那里运行任何命令,我会收到以下错误:
rbox = Rye::Box.new(server, :user => "user", :password => "password")
rbox.ls
指纹 d3:a1:15:ab:05:0d:4e:45:9f:b3:94:14:ca:11:d6:be 与“server,10.10.10.2”不匹配 继续?
Net::SSH::HostKeyMismatch: Net::SSH::HostKeyMismatch
from C:/jruby-1.6.8/lib/ruby/gems/1.8/gems/rye-0.9.8/lib/rye/box.rb:678:in `connect'
from C:/jruby-1.6.8/lib/ruby/gems/1.8/gems/rye-0.9.8/lib/rye/box.rb:778:in `run_command'
from C:/jruby-1.6.8/lib/ruby/gems/1.8/gems/rye-0.9.8/lib/rye/cmd.rb:106:in `which'
from (irb):31:in `evaluate'
from org/jruby/RubyKernel.java:1112:in `eval'
from C:/jruby-1.6.8/lib/ruby/1.8/irb.rb:158:in `eval_input'
from C:/jruby-1.6.8/lib/ruby/1.8/irb.rb:271:in `signal_status'
from C:/jruby-1.6.8/lib/ruby/1.8/irb.rb:270:in `signal_status'
from C:/jruby-1.6.8/lib/ruby/1.8/irb.rb:155:in `eval_input'
from org/jruby/RubyKernel.java:1439:in `loop'
from org/jruby/RubyKernel.java:1212:in `catch'
from C:/jruby-1.6.8/lib/ruby/1.8/irb.rb:154:in `eval_input'
from C:/jruby-1.6.8/lib/ruby/1.8/irb.rb:71:in `start'
from org/jruby/RubyKernel.java:1212:in `catch'
from C:/jruby-1.6.8/lib/ruby/1.8/irb.rb:70:in `start'
from C:\jruby-1.6.8\bin\irb:13:in `(root)'
我已尝试从当前用户主目录 (~/.ssh/known_hosts) 中删除“known_hosts”文件,但仍因同样的问题而失败。 我尝试过与不同的用户联系,但也遇到了同样的问题。
奇怪的是那个指纹总是显示相同的值,所以不确定它来自哪里。
rbox.keys -> 不返回任何内容,只返回 []
rye keys -> NameError: undefined local variable or method `keys' for main:Object
rbox.host_key -> 进程无法访问该文件,因为它正被另一个进程使用。 => [, , 1, ]
知道什么可能导致这个问题,我还能尝试解决或解决它吗?
非常感谢!
【问题讨论】: