0

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

3
  • dont expose your actual password. Commented Oct 7, 2013 at 17:00
  • When you do the ssh manually, are you logged in as root or are you using [email protected] in your ssh request? Commented Oct 7, 2013 at 17:34
  • so...it fails in rails but not ruby? what does "non manual" mean here? What users is it run as for both? Commented Oct 7, 2013 at 20:32

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.