我正在使用 Rye ruby gem 通过 SSH 连接到服务器,我遇到了问题,如果我尝试从那里运行任何命令,我会收到以下错误:
rbox = Rye::Box.new(服务器, :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”不匹配 继续?
网络::SSH::HostKeyMismatch: 网络::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, ]
知道是什么导致了这个问题,还有什么我可以尝试解决或解决它?
非常感谢!