zyriuse
zyriuse

Reputation: 73

ssh connection over ruby script

hy i try to connect in the new server by ruby script

> 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>'

i dont understand why i get this error because when i try manually everything it's working


i try a lot of thing

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

i dont understand why i get all the time the same error

Upvotes: 0

Views: 1233

Answers (1)

fotanus
fotanus

Reputation: 20106

Make sure:

  1. The account is correct
  2. The password is correct
  3. The IP is correct
  4. that ssh [email protected] works from your machine, typing the password

The error AuthenticationFailed means just that.

Upvotes: 1

Related Questions