Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: Interacting with and also capturing an SSH session

$
0
0
This is a conceptual question. I just need to know where to get started.

My application is to connect via SSH to an embedded device and then send a series of commands, parsing the results and sending other commands based on the parsed results.

I can do this already using SshClient and the ShellStream classes.

The problem now is that I would ALSO like to be able to capture ALL the traffic on my ShellStream. In other words, I would like to somehow log everything I am sending/receiving through the ShellStream.

The "hard" way to do this is to explicitly log everything I send and receive by inserting logging calls into all the places where I invoke Send() and Expect(), for example. Unfortunately, this means I need to worry about situations where I use Expect() to capture a particular string in the response to the command I send, but I want to log all the text I get back, not only what is captured by the regex which I give to Expect.

Is there an easy way for me to leave all my command-response interactions untouched but also log everything that comes through the ShellStream?

Viewing all articles
Browse latest Browse all 1729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>