I’m trying to connect from an AIX server to another box, but ssh hangs
after it authenticates. Has anybody seen this, or have any ideas?
doesn’t matter if its connecting to a Solaris, AIX, or linux box.
$ jruby -v
jruby 1.6.3 (ruby-1.8.7-p330) (2011-07-07 965162f) (IBM J9 VM 1.6.0)
[AIX-ppc-java]
$ jruby -S gem list
*** LOCAL GEMS ***
abstract (1.0.0)
actionmailer (3.0.7)
actionpack (3.0.7)
activemodel (3.0.7)
activesupport (3.0.7)
bouncy-castle-java (1.5.0146.1)
builder (2.1.2)
erubis (2.6.6)
i18n (0.6.0, 0.5.0)
jruby-openssl (0.7.4)
log4r (1.1.9)
mail (2.2.19)
mime-types (1.16)
net-ssh (2.1.4, 2.1.0, 2.0.8)
polyglot (0.3.1)
rack (1.2.3)
rack-mount (0.6.14)
rack-test (0.5.7)
treetop (1.4.9)
tzinfo (0.3.27)
SAMPLE CODE:
require ‘rubygems’
require ‘net/ssh’
Net::SSH.start(‘my_server_name’, ‘my_username’, :password =>
“password”, :verbose => :debug) do |ssh|
puts ssh.exec!(“hostname”)
end
And the output:
$ jruby ./ssh.rb
D, [2011-08-02T15:41:13.706000 #1447056960] DEBUG –
net.ssh.transport.session[7fe]: establishing connection to
my_server_name:22
D, [2011-08-02T15:41:13.788000 #1447056960] DEBUG –
net.ssh.transport.session[7fe]: connection established
I, [2011-08-02T15:41:13.790000 #1447056960] INFO –
net.ssh.transport.server_version[800]: negotiating protocol version
D, [2011-08-02T15:41:13.830000 #1447056960] DEBUG –
net.ssh.transport.server_version[800]: remote is SSH-2.0-OpenSSH_5.1' D, [2011-08-02T15:41:13.832000 #1447056960] DEBUG -- net.ssh.transport.server_version[800]: local is
SSH-2.0-Ruby/Net::SSH_2.1.4 java’
D, [2011-08-02T15:41:13.861000 #1447056960] DEBUG – tcpsocket[802]:
read 784 bytes
D, [2011-08-02T15:41:13.864000 #1447056960] DEBUG – tcpsocket[802]:
received packet nr 0 type 20 len 780
I, [2011-08-02T15:41:13.865000 #1447056960] INFO –
net.ssh.transport.algorithms[804]: got KEXINIT from server
I, [2011-08-02T15:41:13.868000 #1447056960] INFO –
net.ssh.transport.algorithms[804]: sending KEXINIT
D, [2011-08-02T15:41:13.872000 #1447056960] DEBUG – tcpsocket[802]:
queueing packet nr 0 type 20 len 556
D, [2011-08-02T15:41:13.874000 #1447056960] DEBUG – tcpsocket[802]:
sent 560 bytes
I, [2011-08-02T15:41:13.875000 #1447056960] INFO –
net.ssh.transport.algorithms[804]: negotiating algorithms
D, [2011-08-02T15:41:13.878000 #1447056960] DEBUG –
net.ssh.transport.algorithms[804]: negotiated:
- kex: diffie-hellman-group-exchange-sha1
- host_key: ssh-rsa
- encryption_server: aes128-cbc
- encryption_client: aes128-cbc
- hmac_client: hmac-sha1
- hmac_server: hmac-sha1
- compression_client: none
- compression_server: none
- language_client:
- language_server:
D, [2011-08-02T15:41:13.879000 #1447056960] DEBUG –
net.ssh.transport.algorithms[804]: exchanging keys
D, [2011-08-02T15:41:15.126000 #1447056960] DEBUG – tcpsocket[802]:
queueing packet nr 1 type 34 len 20
D, [2011-08-02T15:41:15.128000 #1447056960] DEBUG – tcpsocket[802]:
sent 24 bytes
D, [2011-08-02T15:41:15.132000 #1447056960] DEBUG – tcpsocket[802]:
read 152 bytes
D, [2011-08-02T15:41:15.136000 #1447056960] DEBUG – tcpsocket[802]:
received packet nr 1 type 31 len 148
D, [2011-08-02T15:41:15.190000 #1447056960] DEBUG – tcpsocket[802]:
queueing packet nr 2 type 32 len 140
D, [2011-08-02T15:41:15.191000 #1447056960] DEBUG – tcpsocket[802]:
sent 144 bytes
D, [2011-08-02T15:41:15.196000 #1447056960] DEBUG – tcpsocket[802]:
read 464 bytes
D, [2011-08-02T15:41:15.200000 #1447056960] DEBUG – tcpsocket[802]:
received packet nr 2 type 33 len 444
D, [2011-08-02T15:41:15.232000 #1447056960] DEBUG – tcpsocket[802]:
queueing packet nr 3 type 21 len 20
D, [2011-08-02T15:41:15.233000 #1447056960] DEBUG – tcpsocket[802]:
sent 24 bytes
D, [2011-08-02T15:41:15.235000 #1447056960] DEBUG – tcpsocket[802]:
received packet nr 3 type 21 len 12
D, [2011-08-02T15:41:15.238000 #1447056960] DEBUG –
net.ssh.authentication.session[806]: beginning authentication of
`my_user_name’
D, [2011-08-02T15:41:15.242000 #1447056960] DEBUG – tcpsocket[802]:
queueing packet nr 4 type 5 len 28
D, [2011-08-02T15:41:15.243000 #1447056960] DEBUG – tcpsocket[802]:
sent 52 bytes
D, [2011-08-02T15:41:15.272000 #1447056960] DEBUG – tcpsocket[802]:
read 52 bytes
D, [2011-08-02T15:41:15.273000 #1447056960] DEBUG – tcpsocket[802]:
received packet nr 4 type 6 len 28
D, [2011-08-02T15:41:15.275000 #1447056960] DEBUG –
net.ssh.authentication.session[806]: trying password
D, [2011-08-02T15:41:15.277000 #1447056960] DEBUG – tcpsocket[802]:
queueing packet nr 5 type 50 len 60
D, [2011-08-02T15:41:15.277000 #1447056960] DEBUG – tcpsocket[802]:
sent 84 bytes
D, [2011-08-02T15:41:15.430000 #1447056960] DEBUG – tcpsocket[802]:
read 36 bytes
D, [2011-08-02T15:41:15.432000 #1447056960] DEBUG – tcpsocket[802]:
received packet nr 5 type 52 len 12
D, [2011-08-02T15:41:15.433000 #1447056960] DEBUG –
net.ssh.authentication.methods.password[808]: password succeeded
D, [2011-08-02T15:41:15.435000 #1447056960] DEBUG – tcpsocket[802]:
queueing packet nr 6 type 90 len 44
At which point it just sites there.
Exact same code and versions work between linux boxes.
Chris