Advertisement
Guest User

Untitled

a guest
Jun 10th, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.51 KB | None | 0 0
  1. #!/usr/bin/perl
  2. use strict;
  3. use Net::SSH::Perl;
  4.  
  5. my $host = "blah";
  6.  
  7. my $ssh = Net::SSH::Perl->new(
  8.         $host,
  9.         debug => 1,
  10.         options => [
  11.                 "BatchMode yes",
  12.                 "PasswordAuthentication no",
  13.                 "ConnectTimeout 15",
  14.         ]
  15. );
  16.  
  17. $ssh->login("root")
  18.         or die "Failed to login: $!\n";
  19.  
  20. my $cmd = "echo ";
  21. $cmd = "."x50000;
  22.  
  23. my ($stdout, $stderr, $exit) = $ssh->cmd($cmd);
  24. die "Failed!\n"
  25.         unless ($exit == 0);
  26. print "$stdout\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement