#!/usr/bin/env perl
# abbreviated version of https://perlmonks.org/?node_id=1220377
use warnings;
use strict;
use Net::SSH2 ':all';
use Config;
print STDERR "\n__DATA__\n\n";
print STDERR "\$] => $]\n";
print STDERR "$_ => $Config{$_}\n" for qw/archname osname osvers/;
print STDERR "\n\nshell02.theworld.com:\n";
my $ssh2 = Net::SSH2->new();
my $rv = $ssh2->connect('shell02.theworld.com') or $ssh2->die_with_err
+or;
$rv = $ssh2->auth_list() or $ssh2->die_with_error;
+ print STDERR "\tauth_list => $rv\n";
$rv = $ssh2->auth_password_interact('dummyuser') or $ssh2->die_with_er
+ror; print STDERR "\tauth_password_interact
+=> $rv\n";
# this wouldn't work on my strawberry perl: "Non-blocking ReadLine
+ is not supported on this architecture"
__DATA__
$] => 5.026002
archname => MSWin32-x64-multi-thread
osname => MSWin32
osvers => 10.0.16299.371
shell02.theworld.com:
auth_list => publickey,keyboard-interactive
dummyuser's password? Non-blocking ReadLine is not supported on this a
+rchitecture at C:/usr/local/apps/berrybrew/perls/5.26.2_64_PDL/perl/v
+endor/lib/Net/SSH2.pm line 314.
Do you know of a way to get auth_password_interact() to work with Strawberry Perl's version of ReadLine? |