Net::OpenSSH error module

1

I am new to CGI scripting I am trying to connect to another server using Net::OpenSSH but giving the following error

#!/tools/openbin/perl/5.16.3/sparc-sun-solaris8/bin/perl

use strict;
use warnings;
use Net::OpenSSH;

my $host ="**********";
my $user_name = "*******";
my $password_value = "*********";
my $ssh = Net::OpenSSH->new(host => $host, user => $user_name, password => $password_value);
$ssh->error and die "SSH connection failed: " . $ssh->error;

This is giving the following error:

command-line: line 0: Bad configuration option: ServerAliveInterval
SSH connection failed: unable to establish master SSH connection: bad password or master process exited unexpectedly at ./test.pl line 11.

Hemant Chowdary

Posted 2017-10-06T06:05:40.570

Reputation: 11

Answers

1

According to Net::OpenSSH documentation:

The SSH client bundled with Solaris is an early fork of OpenSSH that does not provide the multiplexing functionality required by Net::OpenSSH. You will have to install the OpenSSH client.

Precompiled packages are available from Sun Freeware (http://www.sunfreeware.com). There, select your OS version an CPU architecture, download the OpenSSH package and its dependencies and install them. Note that you do not need to configure Solaris to use the OpenSSH server sshd.

Ensure that OpenSSH client is in your path before the system ssh or alternatively, you can hardcode the full path into your scripts as follows:

$ssh = Net::OpenSSH->new($host,
                     ssh_cmd => '/usr/local/bin/ssh');

AIX and probably some other unixen, also bundle SSH clients lacking the multiplexing functionality and require installation of the real OpenSSH.

Toto

Posted 2017-10-06T06:05:40.570

Reputation: 7 722