Problem using Net::SSH2 module

Ask a Question related to Perl / CGI, Design and Development.

  1. #1

    Default Problem using Net::SSH2 module

    Code:
    #!usr/bin/perl
    
    use warnings;
    
    use Net::SSH2;
    use Net::SSH2::Channel;
    use Data::Dumper;
    my $ssh2 = Net::SSH2->new();
    $ssh2->connect('135.24.224.167') or die $!;
    print Dumper $ssh2;
    my $key = "C:\\private-k\\id_rsa";
    print "Not Found!\n" if (! -e $key);
    #$ssh2->auth_publickey("root","password","C:\\private-k\\id_rsa");
    print $! unless ($ssh2->auth_publickey("root","password","C:\\private-k\\id_rsa") );
    $ssh2->auth_ok();
    my $chan = $ssh2->channel() or die "Channel failed".$!;
    $ssh2->exec("sasaddr");
    while (<$chan>){ print };

    I am trying to execute this code and getting this error :

    Channel failedResource temporarily unavailable at ssh.pl line 20.
    No such file or directory

    Please help in this issue. Am I doing something wrong?
    Last edited by Ravish; September 15th at 10:43 PM. Reason: Added [code] BBCode
    flora_21 Guest

  2. Similar Questions and Discussions

    1. #40534 [NEW]: Problems with output off ssh2 module
      From: sheezes at gmail dot com Operating system: Windows XP PHP version: 5.2.1 PHP Bug Type: Sockets related Bug...
    2. Problem installing GD module
      I have successfully installed the GD module on Darwin (10.3), but now I'm encountering problems trying to install it on Linux Ubuntu 5.04. When I...
    3. problem with Module#append_features
      Hi all, I need to write a constructor-like method for a module. From the help I have found the Module#append_features method, which look like is...
    4. Kernel module 'mga_vid' problem / XV problem
      Hello I have a Matrox Millennium G200 graphics card. When I use the XV extension, videos render scrambled. This does not happen with XSHM (but...
    5. Upgrading from 5.6.0 to 5.8.0 - module problem
      Hi all, new to the group, any help is much appreciated! This is the first time I have touched perl but I have recently bought a new server with...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139