in reply to Is it possible to see what Net::OpenSSH is doing?
Net::OpenSSH or actually the SSH protocol do not work exactly like that. There is not a remote session where you send commands and get the response back.
Instead there is a binary protocol and on top of it bidirectional IO channels can be created and remote commands or port forwarders attached to them.
In general there is no way to see the IO operations happening because there are handled directly by the master ssh program running on the background. The exception is when you use capturing methods as then, it is Net::OpenSSH who is talking at the other side.
In any case, the module has a debugging mode. For instance, setting...
... would give you a good idea of what is going on.$Net::OpenSSH::debug = 4|8|64;
Another possibility is to pipe the output of any command through tee so that it appears on the screen and is also saved to a file:
$ssh->system({ stdout_file => ['|-', 'tee'. 'cmd_output.txt ], stderr_to_stdout => 1 }, @cmd);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Is it possible to see what Net::OpenSSH is doing?
by walkingthecow (Friar) on Jun 12, 2013 at 11:21 UTC | |
by salva (Canon) on Jun 12, 2013 at 11:34 UTC | |
by walkingthecow (Friar) on Jun 12, 2013 at 11:50 UTC |
In Section
Seekers of Perl Wisdom