P
piotr.snarski
Hi Guys,
I'm trying to log into network device using SSH. Below code works perfectlyfor CISCO devices and others. However, to log into a PacketShaper device I'm prompted to insert login twice and in that case below code it not working. Using putty I'm getting such prompts:
login as: #here I just hit eneter
login: # actual username
passowrd: #pass
Do you have any ideas how to force it to work with double login prompts?
#!/usr/bin/perl -w
use strict;
use Net::SSH2;
my $ssh2 = Net::SSH2->new();
$ssh2->debug(1);
$ssh2->connect("host") or die "Unable to connect host $@ \n";
$ssh2->auth_password('admin','password');
my $chan = $ssh2->channel();
$chan->exec('date');
my $buflen = 10000;
my $buf1 = '0' x $buflen;
$chan->read($buf1, $buflen);
print "BUF1:\n", $buf1,"\n";
$chan->exec('exit');
$ssh2->disconnect();
I'm trying to log into network device using SSH. Below code works perfectlyfor CISCO devices and others. However, to log into a PacketShaper device I'm prompted to insert login twice and in that case below code it not working. Using putty I'm getting such prompts:
login as: #here I just hit eneter
login: # actual username
passowrd: #pass
Do you have any ideas how to force it to work with double login prompts?
#!/usr/bin/perl -w
use strict;
use Net::SSH2;
my $ssh2 = Net::SSH2->new();
$ssh2->debug(1);
$ssh2->connect("host") or die "Unable to connect host $@ \n";
$ssh2->auth_password('admin','password');
my $chan = $ssh2->channel();
$chan->exec('date');
my $buflen = 10000;
my $buf1 = '0' x $buflen;
$chan->read($buf1, $buflen);
print "BUF1:\n", $buf1,"\n";
$chan->exec('exit');
$ssh2->disconnect();