Net::SSH 2.0.16 Net::SSH::AuthenticationFailed

69 views
Skip to first unread message

lee

unread,
Dec 9, 2009, 9:38:34 PM12/9/09
to Capistrano
I was told folks on this mailing list might be able to help me with
this problem.

I'm running ruby 1.9.1p243 and net-ssh 2.0.16 and getting this error
trying to connect to a vanilla openssh server on the same LAN:

lee@lee-hp:~$ irb
irb(main):001:0> require 'net/ssh'
=> true
irb(main):002:0> Net::SSH.start
('192.168.1.102',:user=>'lee',:password=>'mypassword')
Net::SSH::AuthenticationFailed: #<Net::SSH::AuthenticationFailed:
0x99457d0>
from /usr/local/lib/ruby/gems/1.9.1/gems/net-ssh-2.0.16/lib/net/
ssh.rb:192:in `start'
from (irb):2
from /usr/local/bin/irb:12:in `<main>'
irb(main):003:0>

/var/log/auth.log on the target ssh server logs the following error on
each attempt:

Invalid user { from 192.168.1.101

Seems like it's not sending the user name correctly, maybe?

I can ssh to this server from a bash shell fine, from any user.

Any help would be greatly appreciated. Thanks.

Lee

Lee Hambley

unread,
Dec 10, 2009, 1:25:15 AM12/10/09
to capis...@googlegroups.com
The Correct Syntax (straight from the RDocs) is :

  Net::SSH.start("host", "user", :password => "password") do |ssh|
result = ssh.exec!("ls -l")
puts result
end
(you send the username as a parameter, password should be part of the options hash.)

-- Lee Hambley

Twitter: @leehambley | @capistranorb
Reply all
Reply to author
Forward
0 new messages