While connecting to the remote host using the Net::SSH::Expect module, 2 out of 10 times I get the error SSHConnectionAborted.
I an unable to find the reason for this error and its solution. Can anybody please help me in this?
I am using the following Perl code:
my $Ssh = Net::SSH::Expect->new(
host => 15.178.209.112,
user => Administrator,
password => Password,
raw_pty => 1,
timeout => 10,
log_stdout => 1
);
eval {$Ssh_Login = $Ssh->login();};
Do not use Net::SSH::Expect, it is just not reliable!
Net::SSH2, Net::OpenSSH (does not work on Cygwin or Windows) or even Net::SSH::Perl are better options.
Update: If all of those fail, Expect may still be a good option.