Open jmcgill298 opened 1 year ago
so I did find out that I needed to add channel.shell().unwrap();
before calling channel.write(message)
in order to have available bytes to write across the channel. However, doing this results in the same issue as using channel.exec(message)
where the response is -vbash: line 1: show: command not found
. I'm not sure why bash
is present since the remote system is not bash, nor why it says show: command not found
when it should be sending show version
, and the normal response from the remote system would be something like incomplete command
.
I reached out on the beginners channel on Discord, but I haven't been able to get help there, so I thought maybe I could open an issue on here. First, I want to say that I tested against a unix device, and this worked as shown in the example; the issue I'm having is with a network appliance. I first tried using the
channel.exec()
function, but this gave me an exit code of 127, and the trace logs showedsh: show: command not found
. The command I'm trying to send isshow version
, so I started thinking that this function was doing more than just sending messages back and forth across the channel. I thought that perhaps thechannel.write()
orchannel.write_all()
would be better suited for my purposes. However, when using these functions, the channel hangs as though it is never done writing, and I'm not sure how to get it to end. I would appreciate any help you can provide.using exec:
using write[_all]:
An example that works using python: