using Net::SSH::Perl with Expect
am 21.11.2005 21:41:46 von dan byersHey everyone, got a code snippet here:
#!/usr/bin/perl
use strict;
use Expect;
use Net::SSH::Perl;
my $connection = new Net::SSH::Perl( "1.2.3.4",
{ protocol => "2,1",
use_pty => 1 } );
$connection->login("user", "pwd");
my $exp = Expect->exp_init($connection->sock);
#$exp->log_stdout(1);
$exp->log_file("./test");
#$exp->raw_pty(1);
$exp->expect(5, ">");
print "got our prompt....\n";
$exp->send("exit\n");
print "sending exit...\n";
$exp->soft_close();
print "done...\n";
I'm trying to get Expect to log all of the transactions with the ssh session
either to the file (as noted) or stdout (as commented). What it outputs
from any of the expect calls is seemingly encrypted.
Is there a way around this? I would prefer to use Expect for interacting
with SSH, and it will have to be Net::SSH::Perl as I want the ssh session to
be within the initial process.
thanks for any help/advice,
Dan