C++ process <-> switch (SSH)

I've created a C tester based on the AIX libssh2.a library. It's running on the AIX server and communicates with a CISCO switch. The purpose is to use SSH instead of Telnet on my C++ process. The session opened (authentication...) fine, and I've succeeded to enable using the libssh2_channel_exec() function.

The received CISCO switch response was: "Password:", and I sent a password using the libssh2_channel_write() function. The write operations completed successfully, but the subsequent read operation didn't retrieve any data. Though, when I've tried a wrong password (to be sure), then the enable command was rejected, so I assume that the correct one was accepted. As well, I've tried to activate the systat and show access-lists operations, using the libssh2_channel_write() function. The write operations completed successfully, but the subsequent read operations didn't retrieve any data.

Is there a way to solve this issue ?

Thanks

Zeev

Sent from my LG-D855 using Tapatalk

Please correct me if I'm wrong.
The CISCO devices routers, firewall and friends we have all require the telnet protocol to make a console connection. This is a standard configuration. AFAIK.

So, SSH connections are treated as something else. I am not a network admin, so I do not know first hand if this is correct.

This document:
Telnet, Console and AUX Port Passwords on Cisco Routers Configuration Example - Cisco

implies that vty connections are software devices for telnet access to EXEC.
There is no mention of ssh access to EXEC command line.

Thanks for the response :slight_smile:

These days, SSH takes place of Telnet in many systems due to its security level. The SSH protocol is supported by the CISCO routers and probably by others too.
The significant changes are mostly in the connection, read and write implementations.
There are diferent versions of libssh and libssh2 libararies. Each has its own rules an methods.
The problem is to find the library that suites your requirements.

Sent from my LG-D855 using Tapatalk