hello folks,
OS: ubuntu 10.10
libssh2 version :1.3.0
remote host'os : cisco pix
when I execute the cmd "./ssh2_exec 10.18.209.205 pix nsfocus 'show version'",the ssh2_exec is the example code from libssh2.
I get info is:
xxx/libssh2-1.3.0/example$ ./ssh2_exec 10.18.209.205 pix nsfocus 'show version'
Host check: 2, key: <none>
libssh2_channel_read returned -37
We read:
Type help or '?' for a list of available commands.
pix> show version
libssh2_channel_read returned -37
libssh2_channel_read returned -37
libssh2_channel_read returned -37
libssh2_channel_read returned -37
libssh2_channel_read returned -37
libssh2_channel_read returned -37
libssh2_channel_read returned -37
libssh2_channel_read returned -37
libssh2_channel_read returned -37
libssh2_channel_read returned -37
libssh2_channel_read returned -37
libssh2_channel_read returned -37
libssh2_channel_read returned -37
libssh2_channel_read returned -37
libssh2_channel_read returned -37
libssh2_channel_read returned -37
libssh2_channel_read returned -37
libssh2_channel_read returned -37
libssh2_channel_read returned -37
libssh2_channel_read returned -37
libssh2_channel_read returned -37
libssh2_channel_read returned -37
libssh2_channel_read returned -43
Got signal: none
all done
From the info I know it has login the remote host but cannot read the channel. I can login the remote host by ssh command and excute cmd which can be 'show version' and get the right info. I can use the ssh2_exec to login remote cisco router except pix. here are the infos of login remote pix:
libssh2-1.3.0/example$ ssh pix_at_10.18.209.205
pix_at_10.18.209.205's password:
Type help or '?' for a list of available commands.
pix> show version
Cisco PIX Security Appliance Software Version 7.2(2)
Compiled on Wed 22-Nov-06 14:16 by builders
System image file is "Unknown, monitor mode tftp booted image"
Config file at boot was "startup-config"
pix up 8 hours 52 mins
.......
by the way, I can use the example code ssh2 to login the remote host.
Under the debug command of strace'help ,I think the 'show version' may not be send out,here are infos:
recv(3, 0x95c30a0, 16384, MSG_NOSIGNAL) = -1 EAGAIN (Resource temporarily unavailable)
recv(3, "(\230Q\254\25\2242zs-\365\375_\313\263Dj\3015\f\212\237\224sDZ\27&\245\304\243j"..., 16384, MSG_NOSIGNAL) = 36
send(3, "\220X\f@\305\21\234\276<\5t\377\373\376\31n\37\224\222\215\216\356'\272\256\230Y&\5\353h\315"..., 68, MSG_NOSIGNAL) = 68
recv(3, 0x95c30a0, 16384, MSG_NOSIGNAL) = -1 EAGAIN (Resource temporarily unavailable)
recv(3, "\224\311e+\23\17\356\254\206\255D\241\376\375\357\224\247\205*\237\0229S\2117\1\223w3I\347\36"..., 16384, MSG_NOSIGNAL) = 52
send(3, ")\230K\356\275Ene \0\33\f\300\205\30A\17\312g\272\5\201\f\337\253\266\233\206\234\344\215F"..., 68, MSG_NOSIGNAL) = 68
recv(3, 0x95c30a0, 16384, MSG_NOSIGNAL) = -1 EAGAIN (Resource temporarily unavailable)
recv(3, "vS\372\2777m\211\326\341\204\31Cv\240G\342\325\222\261\f\245\321\0104\0\25\337\0337\6$\243"..., 16384, MSG_NOSIGNAL) = 36
recv(3, 0x95c30a0, 16384, MSG_NOSIGNAL) = -1 EAGAIN (Resource temporarily unavailable)
libssh2_channel_read returned -37
recv(3, "\251\307\342\205\30x\204\243\226*\302\366\5\354\366\322\266\333\251\316x\247\267\243Cl\265b\205\307n\t"..., 16384, MSG_NOSIGNAL) = 776
recv(3, 0x95c30a0, 16384, MSG_NOSIGNAL) = -1 EAGAIN (Resource temporarily unavailable)
We read:
Type help or '?' for a list of available commands.
pix> show version
recv(3, 0x95c30a0, 16384, MSG_NOSIGNAL) = -1 EAGAIN (Resource temporarily unavailable)
libssh2_channel_read returned -37
Thanks for any help
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2011-12-08