Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: JRuby 1.5.0.RC1, JRuby-OpenSSL 0.7
-
Fix Version/s: None
-
Component/s: OpenSSL
-
Labels:None
-
Environment:Solaris 10, JRuby 1.5.0RC1, jruby-openssl (0.7), net-ssh (2.0.22)
-
Testcase included:yes
-
Number of attachments :
Description
I'm seeing Net::SSH fail with :auth_methods => ['keyboard-interactive','password']. This seems to have something to do with how Net::SSH is handling user input under JRuby. If I change the test code to remove :auth_methods and instead hard-code the password in the parameters passed to Net::SSH.start, authentication works.
Test code:
ENV["RUBY_FFI_NCURSES_LIB"] = 'libncurses.so.5' require 'rubygems' require 'ffi-ncurses' require 'highline' require 'net/ssh' Net::SSH.start('b3pcvsap1.mg.ny.frb.org', 'webadmin', :verbose => :debug, :auth_methods => ['keyboard-interactive','password'] ) do |ssh| puts ssh.exec!("hostname") end
Output:
D, [2010-04-28T13:46:31.021000 #25874] DEBUG -- net.ssh.transport.session[7e4]: establishing connection to [HOST]:[PORT]
D, [2010-04-28T13:46:31.120000 #25874] DEBUG -- net.ssh.transport.session[7e4]: connection established
I, [2010-04-28T13:46:31.123000 #25874] INFO -- net.ssh.transport.server_version[7e6]: negotiating protocol version
D, [2010-04-28T13:46:31.131000 #25874] DEBUG -- net.ssh.transport.server_version[7e6]: remote is `SSH-2.0-Sun_SSH_1.1.3'
D, [2010-04-28T13:46:31.134000 #25874] DEBUG -- net.ssh.transport.server_version[7e6]: local is `SSH-2.0-Ruby/Net::SSH_2.0.22 java'
D, [2010-04-28T13:46:31.360000 #25874] DEBUG -- tcpsocket[7e8]: read 376 bytes
D, [2010-04-28T13:46:31.427000 #25874] DEBUG -- tcpsocket[7e8]: received packet nr 0 type 20 len 372
I, [2010-04-28T13:46:31.430000 #25874] INFO -- net.ssh.transport.algorithms[7ea]: got KEXINIT from server
I, [2010-04-28T13:46:31.435000 #25874] INFO -- net.ssh.transport.algorithms[7ea]: sending KEXINIT
D, [2010-04-28T13:46:31.442000 #25874] DEBUG -- tcpsocket[7e8]: queueing packet nr 0 type 20 len 556
D, [2010-04-28T13:46:31.445000 #25874] DEBUG -- tcpsocket[7e8]: sent 560 bytes
I, [2010-04-28T13:46:31.447000 #25874] INFO -- net.ssh.transport.algorithms[7ea]: negotiating algorithms
D, [2010-04-28T13:46:31.452000 #25874] DEBUG -- net.ssh.transport.algorithms[7ea]: negotiated:
* kex: diffie-hellman-group-exchange-sha1
* host_key: ssh-rsa
* encryption_server: aes128-cbc
* encryption_client: aes128-cbc
* hmac_client: hmac-md5
* hmac_server: hmac-md5
* compression_client: none
* compression_server: none
* language_client:
* language_server:
D, [2010-04-28T13:46:31.454000 #25874] DEBUG -- net.ssh.transport.algorithms[7ea]: exchanging keys
D, [2010-04-28T13:46:37.645000 #25874] DEBUG -- tcpsocket[7e8]: queueing packet nr 1 type 34 len 20
D, [2010-04-28T13:46:37.648000 #25874] DEBUG -- tcpsocket[7e8]: sent 24 bytes
D, [2010-04-28T13:46:37.663000 #25874] DEBUG -- tcpsocket[7e8]: read 152 bytes
D, [2010-04-28T13:46:37.666000 #25874] DEBUG -- tcpsocket[7e8]: received packet nr 1 type 31 len 148
D, [2010-04-28T13:46:38.026000 #25874] DEBUG -- tcpsocket[7e8]: queueing packet nr 2 type 32 len 140
D, [2010-04-28T13:46:38.029000 #25874] DEBUG -- tcpsocket[7e8]: sent 144 bytes
D, [2010-04-28T13:46:38.056000 #25874] DEBUG -- tcpsocket[7e8]: read 464 bytes
D, [2010-04-28T13:46:38.060000 #25874] DEBUG -- tcpsocket[7e8]: received packet nr 2 type 33 len 444
D, [2010-04-28T13:46:38.438000 #25874] DEBUG -- tcpsocket[7e8]: queueing packet nr 3 type 21 len 20
D, [2010-04-28T13:46:38.440000 #25874] DEBUG -- tcpsocket[7e8]: sent 24 bytes
D, [2010-04-28T13:46:38.444000 #25874] DEBUG -- tcpsocket[7e8]: received packet nr 3 type 21 len 12
D, [2010-04-28T13:46:38.457000 #25874] DEBUG -- net.ssh.authentication.session[7ec]: beginning authentication of `[USER]'
D, [2010-04-28T13:46:38.491000 #25874] DEBUG -- tcpsocket[7e8]: queueing packet nr 4 type 5 len 28
D, [2010-04-28T13:46:38.493000 #25874] DEBUG -- tcpsocket[7e8]: sent 48 bytes
D, [2010-04-28T13:46:38.510000 #25874] DEBUG -- tcpsocket[7e8]: read 48 bytes
D, [2010-04-28T13:46:38.518000 #25874] DEBUG -- tcpsocket[7e8]: received packet nr 4 type 6 len 28
D, [2010-04-28T13:46:38.522000 #25874] DEBUG -- net.ssh.authentication.session[7ec]: trying keyboard-interactive
D, [2010-04-28T13:46:38.525000 #25874] DEBUG -- net.ssh.authentication.methods.keyboard_interactive[7ee]: trying keyboard-interactive
D, [2010-04-28T13:46:38.533000 #25874] DEBUG -- tcpsocket[7e8]: queueing packet nr 5 type 50 len 76
D, [2010-04-28T13:46:38.536000 #25874] DEBUG -- tcpsocket[7e8]: sent 96 bytes
D, [2010-04-28T13:46:38.541000 #25874] DEBUG -- tcpsocket[7e8]: read 64 bytes
D, [2010-04-28T13:46:38.549000 #25874] DEBUG -- tcpsocket[7e8]: received packet nr 5 type 51 len 44
D, [2010-04-28T13:46:38.552000 #25874] DEBUG -- net.ssh.authentication.session[7ec]: allowed methods: password,keyboard-interactive
D, [2010-04-28T13:46:38.554000 #25874] DEBUG -- net.ssh.authentication.methods.keyboard_interactive[7ee]: keyboard-interactive failed
D, [2010-04-28T13:46:38.556000 #25874] DEBUG -- net.ssh.authentication.session[7ec]: trying password
E, [2010-04-28T13:46:38.558000 #25874] ERROR -- net.ssh.authentication.session[7ec]: all authorization methods failed (tried keyboard-interactive, password)
/[...]/jruby-1.5.0.RC1/lib/ruby/gems/1.8/gems/net-ssh-2.0.22/lib/net/ssh.rb:192:in `start': [USER] (Net::SSH::AuthenticationFailed)
from testSSH.rb:10
Local gems:
columnize (0.3.1)
ffi-ncurses (0.3.2)
highline (1.5.2)
jruby-openssl (0.7)
net-ssh (2.0.22)
rake (0.8.7)
rspec (1.3.0)
ruby-debug (0.10.3)
ruby-debug-base (0.10.3.1)
sources (0.0.1)