udvk009 has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks,
I am using Net::OpenSSH module and when i run the script it prompts me for password and after keying in the password to remote server it fails with below error message.
Note : I can already ssh from my working server to the remote server hence no network issues here.
In some other threads i also set "ControlMaster yes" in /etc/ssh/ssh_config but that didn't help. Can some one point me to right direction? I had tried installing Net:SSH:Perl but with no success ( will post another thread for getting help on that)
Platform : Linux (RH-4) Perl version : ActivePerl-5.14.2.1402
Error Message : unable to establish master SSH connection: control command failed: chi +ld exited with code 1 Verbose Logs ( error is at last line) : debug1: Trying to start again debug2: we sent a gssapi-with-mic packet, wait for reply debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mi +c,publickey,password,keyboard-interactive debug2: we did not send a packet, disable method debug3: authmethod_lookup publickey debug3: remaining preferred: keyboard-interactive,password debug3: authmethod_is_enabled publickey debug1: Next authentication method: publickey debug1: Trying private key: /home/kanerku/.ssh/id_rsa debug3: no such identity: /home/kanerku/.ssh/id_rsa debug1: Trying private key: /home/kanerku/.ssh/id_dsa debug3: no such identity: /home/kanerku/.ssh/id_dsa debug2: we did not send a packet, disable method debug3: authmethod_lookup keyboard-interactive debug3: remaining preferred: password debug3: authmethod_is_enabled keyboard-interactive debug1: Next authentication method: keyboard-interactive debug2: userauth_kbdint debug2: we sent a keyboard-interactive packet, wait for reply debug2: input_userauth_info_req debug2: input_userauth_info_req: num_prompts 1 Password: debug3: packet_send2: adding 32 (len 23 padlen 9 extra_pad 64) debug1: Authentication succeeded (keyboard-interactive). debug2: fd 4 setting O_NONBLOCK debug1: Entering interactive session. debug1: Transferred: stdin 0, stdout 0, stderr 0 bytes in 2.6 seconds debug1: Bytes per second: stdin 0.0, stdout 0.0, stderr 0.0 debug1: Exit status 0 Couldn't establish SSH connection: unable to establish master SSH conn +ection: control command failed: child exited with code 1 at ./gen_pas +swd.pl line 21.
PERL SCRIPT :
#! /usr/local/ActivePerl-5.14.2.1402/bin/perl use Net::OpenSSH; my $host="zhkdsd201"; my $ssh = Net::OpenSSH->new($host, user => 'hkuat', master_opts => '-vvv', strict_mode => 0 ); $ssh->error and die "Couldn't establish SSH connection: ". $ssh->error;

Replies are listed 'Best First'.
Re: Net::OpenSSH - unable to establish master SSH connection: control command failed
by salva (Canon) on Jan 07, 2013 at 13:15 UTC
    Turn on debugging before calling the constructor and post the output:
    $Net::OpenSSH::debug=-1;
    Which version of OpenSSH are you using (ssh -V)?

    Also, some custom configuration on ~/.ssh/config may be interfering with the module inner workings.

      Hi Salva, Thanks for your reply!
      I managed to resolve this issue by installing open ssh (OpenSSH_5.9p1)
      Seems like the problem was with the old ssh (OpenSSH_3.9p1)
      Cheers!
        where to download OpenSSH_5.9p1 for RedHat el5