我尝试通过 ruby 脚本连接到新服务器
> 1.9.2p320 :038 > Net::SSH.start('192.168.10.80', 'root', :password => 'xxxxx')
> Net::SSH::AuthenticationFailed: root
> from /home/zyriuse/.rvm/gems/ruby-1.9.2-p320/gems/net-ssh-2.7.0/lib/net/ssh.rb:215:in > `start'
> from (irb):38
> from /home/zyriuse/.rvm/rubies/ruby-1.9.2-p320/bin/irb:16:in `<main>'
我不明白为什么会出现此错误,因为当我手动尝试一切正常时
我尝试了很多东西
require 'net/ssh'
require 'logger'
Net::SSH.start(
'localhost', 'zyriuse',
:keys => [ "~/.ssh/id_dsa.pub" ],
) do |session|
puts "hello "
end
~
zyriuse (Net::SSH::AuthenticationFailed)
Net::SSH.start( 'host',
:password=>'passord',
:port=>22,
:username=>'zyriuse',
... ) do |session|
puts "hello wordl"
end
`start': Net::SSH::AuthenticationFailed
我不明白为什么我总是遇到同样的错误