Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- use strict;
- use Net::SSH::Perl;
- my $host = "blah";
- my $ssh = Net::SSH::Perl->new(
- $host,
- debug => 1,
- options => [
- "BatchMode yes",
- "PasswordAuthentication no",
- "ConnectTimeout 15",
- ]
- );
- $ssh->login("root")
- or die "Failed to login: $!\n";
- my $cmd = "echo ";
- $cmd = "."x50000;
- my ($stdout, $stderr, $exit) = $ssh->cmd($cmd);
- die "Failed!\n"
- unless ($exit == 0);
- print "$stdout\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement