C++ process <-> switch (SSH)


 
Thread Tools Search this Thread
Top Forums Programming C++ process <-> switch (SSH)
# 1  
Old 08-20-2016
C++ process &amp;lt;-&amp;gt; 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

Last edited by zeev; 08-20-2016 at 06:53 PM..
# 2  
Old 08-20-2016
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.
# 3  
Old 08-21-2016
Thanks for the response Smilie

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

Last edited by zeev; 08-21-2016 at 04:50 PM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[solved] Process ssh command in while loop

I have a script that reads a file containing a list of server names. It's suppose to loop through the list of names and execute a command on the remote server using ssh. It processes the ssh command for the first server in the list and then exits. Here's the code: #!/bin/bash ... (2 Replies)
Discussion started by: westmoreland
2 Replies

2. Shell Programming and Scripting

SSH Process monitoring and Exit Status evaluation

Hi All, I have a peculiar requirement as follows, I have a some hosts on which i have to run a script, so i am using the following code piece for i in $HOSTLIST do ssh ${i} "~/task.sh" done Now i want to run this same thing in parallel on all the hosts and then monitor the ssh process... (1 Reply)
Discussion started by: mihirvora16
1 Replies

3. Linux

How to switch from command to SSH mode?

Hi all, I am new to CentOS and have been always using the server remotely using puTTy. I needed to access the machine from the console so I did a Alt+F2. Now I would like to go back to using the machine remotely via SSH. Can you please let me know what keys on the console I should hit to be... (6 Replies)
Discussion started by: tezarin
6 Replies

4. Shell Programming and Scripting

how to access console of a switch having rj45 on switch side to db 9 female on pc side console cable

hi, how to access console of a switch having rj45 on switch side to db 9 female on pc side console cable which needs to be connected to one console server having rj11 on its side and db 9 female on other end.i.e. on switch side,console cable has rj45 and db 9 pin female connector on other side of... (1 Reply)
Discussion started by: pankajd
1 Replies

5. Shell Programming and Scripting

SSH starting nohup'd process - not exiting

I'm trying to ssh into a remote server, run a script which may or may not start a nohup'd background process and then exit leaving the process running on the remote server. I'm looping through a number of servers to do this but the script hangs as soon as it comes to a server where the remote... (3 Replies)
Discussion started by: Steve_H
3 Replies

6. UNIX for Advanced & Expert Users

attach process from another ssh session

Hi, I was logged in on a server, by ssh, with a vim open, when the battery of my laptop got empty. When I return to the server by ssh, I can see my previous ssh session still open, and the vim process running (ttyp0). Is there a way to attach that vim to my new session (ttyp4)? Here's part... (2 Replies)
Discussion started by: raphinou
2 Replies

7. UNIX for Dummies Questions & Answers

Closing ssh when process run on remote

Hi! I currently run a very long script (two hour left...) on a remote computer through a ssh session. I wonder whats happend if I close the ssh session, or even, the terminal. Is the script running on remote will stop? Thanks for your answers, Tp (1 Reply)
Discussion started by: tipi
1 Replies

8. Shell Programming and Scripting

how to connect to server with ssh to check process size

Hello i have to connect to 11 servers to check the process size on every server. how to that with shell scripting using ssh regards (7 Replies)
Discussion started by: mogabr
7 Replies

9. Shell Programming and Scripting

How to starting process as daemon using ssh command?

Hello, I need to run a command on remote Linux using the ssh command from my local machine. I am able to execute the command on remote machine using ssh but it's behaving strangely. The command is supposed to start a daemon process on remote linux box and the control should return back to me... (5 Replies)
Discussion started by: nitinshukla
5 Replies

10. UNIX for Advanced & Expert Users

Control process from different terminal (over SSH)

I pressed CTRL Z and suspended the job. then I pressed bg, The process re-started to throw output on the terminal and its not allowing me to access the prompt. its not even accepting CTRL Z. The process has been running for about 2 hours now and I want to suspend it by opening another terminal.... (3 Replies)
Discussion started by: rakeshou
3 Replies
Login or Register to Ask a Question