S
scottdware
Hello,
I am having trouble on some of my SSH scripts that are using the
Net::Appliance::Session module on a Unix (Solaris 9) box.
Basically, I keep getting the error:
"Login failed to remote host at line..."
"Pattern match time-out"
Can you see any reason as to why I am getting that? If I use this on
Cygwin, it works fine, but I don't know why it wouldn't work on Unix?
Here's a test script:
#!/usr/local/bin/perl
use strict;
use warnings;
use Net::Appliance::Session;
my $user = "username";
my $pass = "password";
my $host = "somehost.domain.com";
my $command = "show ip int brie";
my $ssh = Net::Appliance::Session->new(Host => $host, Transport =>
'SSH');
eval {
$ssh->connect(Name => $user, Password => $pass, SHKC => 0);
$ssh->cmd(String => $command, Timeout => 30);
sleep 2;
};
if (UNIVERSAL::isa($@, 'Net::Appliance::Session::Exception')) {
print $@->message ."\n";
print $@->lastline ."\n";
print $@->errmsg ."\n";
}
I am having trouble on some of my SSH scripts that are using the
Net::Appliance::Session module on a Unix (Solaris 9) box.
Basically, I keep getting the error:
"Login failed to remote host at line..."
"Pattern match time-out"
Can you see any reason as to why I am getting that? If I use this on
Cygwin, it works fine, but I don't know why it wouldn't work on Unix?
Here's a test script:
#!/usr/local/bin/perl
use strict;
use warnings;
use Net::Appliance::Session;
my $user = "username";
my $pass = "password";
my $host = "somehost.domain.com";
my $command = "show ip int brie";
my $ssh = Net::Appliance::Session->new(Host => $host, Transport =>
'SSH');
eval {
$ssh->connect(Name => $user, Password => $pass, SHKC => 0);
$ssh->cmd(String => $command, Timeout => 30);
sleep 2;
};
if (UNIVERSAL::isa($@, 'Net::Appliance::Session::Exception')) {
print $@->message ."\n";
print $@->lastline ."\n";
print $@->errmsg ."\n";
}