Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use strict;
- use warnings;
- use Net::SSH::Perl;
- my $stdout;
- my $stderr;
- my $exit;
- #foreach my $i (10..19) {
- my $host = "*.*.*.*";
- my $user = "********";
- my $pass = "********";
- print "Opening Connect to $host \n";
- my $ssh = Net::SSH::Perl->new($host);
- print "Sending Login Credentials \n";
- $ssh->login($user, $pass);
- print "Sending Commands \n";
- my $command = "version";
- print "Commands sent \n";
- $ssh->register_handler("stdout", sub {
- my($channel, $buffer) = @_;
- my $str = $buffer->bytes;
- print "$str\n";
- });
- ($stdout,$stderr,$exit) = $ssh->cmd($command);
- #}
Advertisement
Add Comment
Please, Sign In to add comment