Subject: Re: cannot execute cmd at cisco pix

Re: cannot execute cmd at cisco pix

From: Peter Stuge <peter_at_stuge.se>
Date: Sat, 10 Dec 2011 09:25:39 +0100

shengqi158 wrote:
> When I use the example code ssh2_exec to login the remote pix host,
> the pix's terminal is still exist and I can input other command
> likes "enable","show version" and so. However,when I use the
> example code ssh2_exec to login other host(not pix system), the
> remote host's terminal disappeared. So I think the pix's
> implemention of ssh2's channel is different from standard ssh2's
> channel.

No. All problems you are experiencing with the ssh2_exec.c example
are because the file is a simple example with the purpose of
demonstrating how to use libssh2.

In particular, ssh2_exec.c is NOT a terminal emulator, so it is
impossible to use it successfully when a terminal emulator is
expected, such as with all interactive CLIs which use SSH.

libssh2 has nothing to do with terminals and terminal emulation. If
you need those features then you must combine libssh2 with software
which will provide them. libssh2 only handles the lowlevel SSH
protocol itself and is not concerned about what data is transferred
in the session.

I recommend reading the SSH RFCs. They are short and readable. Please
see http://trac.libssh2.org/wiki/FAQ#WhatistheSSH-2protocol

//Peter
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2011-12-10