B
bsingh
I get the following error even though it is clearly connecting. Any
amount of timeout is not helping.
How do I avoid this exception? Thank you.
SSHAuthenticationError Login timed out. The input stream currently has
the contents bellow: Last login: Fri Jan 8 20:20:46 2010 from
gildb118.flowserve.net
at /cygdrive/c/Data/perl_mods/lib/Expect.pm line 828
at /cygdrive/c/Data/perl_mods/lib/Net/SSH/Expect.pm line 209
Net::SSH::Expect::__ANON__[/cygdrive/c/Data/perl_mods/lib/Net/
SSH/Expect.pm:212]('ARRAY(0x10530758)') called at /cygdrive/c/Data/
perl_mods/lib/Expect.pm line 828
Expect::_multi_expect(1, 'ARRAY(0x105308d8)', 'ARRAY
(0x10530ae8)') called at /cygdrive/c/Data/perl_mods/lib/Expect.pm line
565
Expect::expect('Expect=GLOB(0x10576940)', 1, 'ARRAY
(0x105776c0)', 'ARRAY(0x10530218)', 'ARRAY(0x10530338)', 'ARRAY
(0x10530458)', 'ARRAY(0x10530590)') called at /cygdrive/c/Data/
perl_mods/lib/Net/SSH/Expect.pm line 580
Net::SSH::Expect::_sec_expect('Net::SSH::Expect=HASH
(0x10517c08)', 1, 'ARRAY(0x105776c0)', 'ARRAY(0x10530218)', 'ARRAY
(0x10530338)', 'ARRAY(0x10530458)', 'ARRAY(0x10530590)') called at /
cygdrive/c/Data/perl_mods/lib/Net/SSH/Expect.pm line 213
Net::SSH::Expect::login('Net::SSH::Expect=HASH(0x10517c08)')
called at netsshexpect.pl line 13
Here's the code
------------------------------------------
use Net::SSH::Expect;
my $ssh = Net::SSH::Expect->new (
host => $host,
password=> $pwd,
user => $usr,
raw_pty => 1,
timeout => 10
);
my $login_output = $ssh->login();
# disable terminal translations and echo on the SSH server
# executing on the server the stty command:
$ssh->exec("stty raw -echo");
my $cmd = "ls -l";
my $cmd_out;
$cmd_out = $ssh->exec($cmd);
print "\n";
amount of timeout is not helping.
How do I avoid this exception? Thank you.
SSHAuthenticationError Login timed out. The input stream currently has
the contents bellow: Last login: Fri Jan 8 20:20:46 2010 from
gildb118.flowserve.net
at /cygdrive/c/Data/perl_mods/lib/Expect.pm line 828
at /cygdrive/c/Data/perl_mods/lib/Net/SSH/Expect.pm line 209
Net::SSH::Expect::__ANON__[/cygdrive/c/Data/perl_mods/lib/Net/
SSH/Expect.pm:212]('ARRAY(0x10530758)') called at /cygdrive/c/Data/
perl_mods/lib/Expect.pm line 828
Expect::_multi_expect(1, 'ARRAY(0x105308d8)', 'ARRAY
(0x10530ae8)') called at /cygdrive/c/Data/perl_mods/lib/Expect.pm line
565
Expect::expect('Expect=GLOB(0x10576940)', 1, 'ARRAY
(0x105776c0)', 'ARRAY(0x10530218)', 'ARRAY(0x10530338)', 'ARRAY
(0x10530458)', 'ARRAY(0x10530590)') called at /cygdrive/c/Data/
perl_mods/lib/Net/SSH/Expect.pm line 580
Net::SSH::Expect::_sec_expect('Net::SSH::Expect=HASH
(0x10517c08)', 1, 'ARRAY(0x105776c0)', 'ARRAY(0x10530218)', 'ARRAY
(0x10530338)', 'ARRAY(0x10530458)', 'ARRAY(0x10530590)') called at /
cygdrive/c/Data/perl_mods/lib/Net/SSH/Expect.pm line 213
Net::SSH::Expect::login('Net::SSH::Expect=HASH(0x10517c08)')
called at netsshexpect.pl line 13
Here's the code
------------------------------------------
use Net::SSH::Expect;
my $ssh = Net::SSH::Expect->new (
host => $host,
password=> $pwd,
user => $usr,
raw_pty => 1,
timeout => 10
);
my $login_output = $ssh->login();
# disable terminal translations and echo on the SSH server
# executing on the server the stty command:
$ssh->exec("stty raw -echo");
my $cmd = "ls -l";
my $cmd_out;
$cmd_out = $ssh->exec($cmd);
print "\n";