Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] How to login from one system (A) into remote system (B) and do a ping to the third system (C) with Perl and CGI !

Expand Messages
  • leebinkley
    #!/usr/bin/perl use Net::SSH::Perl; my $host = perlhowto.com ; my $user = user ; my $password = password ; #-- set up a new connection my $ssh =
    Message 1 of 3 , Apr 12, 2009
    • 0 Attachment

      use Net::SSH::Perl;

      my $host = "perlhowto.com";
      my $user = "user";
      my $password = "password";

      #-- set up a new connection
      my $ssh = Net::SSH::Perl->new($host);
      #-- authenticate
      $ssh->login($user, $pass);
      #-- execute the command
      my($stdout, $stderr, $exit) = $ssh->cmd("ls -l /home/$user");

      Posted through Grouply, the better way
      to access your Yahoo Groups like this one.

      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.