Help for this page

Select Code to Download


  1. or download this
     use Net::OpenSSH::Compat::SSH2 qw(:supplant);
    use Net::SSH2;
    
    ...
    my $res = $ssh2->auth(username => $username,
                          password => $password,) or die "$!",$ssh2->error
    +;
    print "result is $res\n";
    
  2. or download this
     > perl compatssh2.pl 
    # ctl_path: /home/smokes/.libnet-openssh-perl/regression-192.168.2.-11
    +175-417065, ctl_dir: /home/smokes/.libnet-openssh-perl/
    # _is_secure_path(dir: /home/smokes/.libnet-openssh-perl, file mode: 1
    +6832, file uid: 1003, euid: 1003
    ...
    # waitpid(master: 11177) => pid: 11177, rc: Interrupted system call
    # DESTROY(Net::OpenSSH=HASH(0xdb75b0), pid: <undef>)
    Interrupted system callLIBSSH2_ERROR_SOCKET_DISCONNECTunable to establ
    +ish master SSH connection: the authenticity of the target host can't 
    +be established, the remote host public key is probably not present on
    + the '~/.ssh/known_hosts' file at compatssh2.pl line 13.