Net::SSH::W32Perl Script hanging when trying to return data

From: Dark (darkknight69_at_gmail.com)
Date: 03/10/05

  • Next message: Slaven Rezic: "Re: libwww-perl 5.803 failures"
    Date: 10 Mar 2005 12:30:01 -0800
    
    

    Dark Mar 10, 12:14 pm show options
    Newsgroups: comp.lang.perl.modules
    From: "Dark" <darkknigh...@gmail.com> - Find messages by this author
    Date: 10 Mar 2005 12:14:07 -0800
    Local: Thurs, Mar 10 2005 12:14 pm
    Subject: Net::SSH::W32Perl Script hanging when trying to return data
    Reply | Reply to Author | Forward | Print | Individual Message | Show
    original | Remove | Report Abuse

    Im trying to return an ls -l and when I execute my Perl Script it
    hangs. It seems Im not processing stdout properly.

    C:\>ssh_test2.pl
    Use of uninitialized value in concatenation (.) or string at
    C:/Perl/site/lib/Net/SSH/Perl.pm
     line 107.
    phl3-0021647: Reading configuration data /.ssh/config
    phl3-0021647: Reading configuration data /etc/ssh_config
    phl3-0021647: Connecting to str7922app, port 22.
    phl3-0021647: Socket created, turning on blocking...
    phl3-0021647: Remote protocol version 2.0, remote software version
    OpenSSH_3.4p1
    phl3-0021647: Net::SSH::Perl Version 1.25, protocol version 2.0.
    Use of uninitialized value in concatenation (.) or string at
    C:/Perl/site/lib/Net/SSH/Perl/SS
    H2.pm line 41, <GEN0> line 1.
    Use of uninitialized value in concatenation (.) or string at
    C:/Perl/site/lib/Net/SSH/Perl/SS
    H2.pm line 47, <GEN0> line 1.
    phl3-0021647: No compat match: OpenSSH_3.4p1.
    phl3-0021647: Connection established.
    phl3-0021647: Sent key-exchange init (KEXINIT), wait response.
    phl3-0021647: Algorithms, c->s: 3des-cbc hmac-sha1 none
    phl3-0021647: Algorithms, s->c: 3des-cbc hmac-sha1 none
    phl3-0021647: Entering Diffie-Hellman Group 1 key exchange.
    phl3-0021647: Sent DH public key, waiting for reply.
    phl3-0021647: Received host key, type 'ssh-dss'.
    phl3-0021647: Host 'str7922app' is known and matches the host key.
    phl3-0021647: Computing shared secret key.
    phl3-0021647: Verifying server signature.
    phl3-0021647: Waiting for NEWKEYS message.
    phl3-0021647: Enabling incoming encryption/MAC/compression.
    phl3-0021647: Send NEWKEYS, enable outgoing encryption/MAC/compression.
    phl3-0021647: Sending request for user-authentication service.
    phl3-0021647: Service accepted: ssh-userauth.
    phl3-0021647: Trying empty user-authentication request.
    phl3-0021647: Authentication methods that can continue:
    publickey,password.
    phl3-0021647: Next method to try is publickey.
    phl3-0021647: Next method to try is password.
    phl3-0021647: Trying password authentication.
    phl3-0021647: Login completed, opening dummy shell channel.
    phl3-0021647: channel 0: new [client-session]
    phl3-0021647: Requesting channel_open for channel 0.
    phl3-0021647: channel 0: open confirm rwindow 0 rmax 32768
    phl3-0021647: Got channel open confirmation, requesting shell.
    phl3-0021647: Requesting service shell on channel 0.
    phl3-0021647: channel 1: new [client-session]
    phl3-0021647: Requesting channel_open for channel 1.
    phl3-0021647: Entering interactive session.
    phl3-0021647: Sending command: uname
    phl3-0021647: Requesting service exec on channel 1.
    phl3-0021647: channel 1: send eof
    phl3-0021647: channel 1: open confirm rwindow 131070 rmax 32768
    phl3-0021647: channel 1: rcvd eof
    phl3-0021647: channel 1: output open -> drain
    phl3-0021647: input_channel_request: rtype exit-status reply 0
    phl3-0021647: channel 1: rcvd close
    Terminating on signal SIGINT(2)

    C:\>

    Here is the script

    #!/usr/bin/perl -w

    use Net::SSH::W32Perl;
    my %params;
    $params{debug} = 1;
    #$params{protocol} = 1;
    $params{port} = 22;

    $host = "host";
    $user = "user1";
    $pass = "XXXXX";

    $ssh = new Net::SSH::W32Perl($host, %params);
    $ssh -> login($user, $pass);
    my ($out, $err, $exit) = $ssh -> cmd('ls' ,"\n");
    print "Standard out: $out\nStandard Error: $err\nExit code: $exit\n";
    $ssh->cmd("exit");


  • Next message: Slaven Rezic: "Re: libwww-perl 5.803 failures"

    Relevant Pages

    • Re: Net:SFTP Configuration
      ... Connecting to sacsun120... ... Remote protocol version 2.0, ... Login completed, opening dummy shell channel. ... requesting shell. ...
      (perl.beginners)
    • Net::SSH::W32Perl Script hanging when trying to return data
      ... Im trying to return an ls -l and when I execute my Perl Script it ... Login completed, opening dummy shell channel. ... requesting shell. ... Requesting service shell on channel 0. ...
      (comp.lang.perl.modules)
    • Net::SSH::W32Perl Script hanging when trying to return data
      ... Im trying to return an ls -l and when I execute my Perl Script it ... Login completed, opening dummy shell channel. ... requesting shell. ... Requesting service shell on channel 0. ...
      (perl.beginners)
    • Error using perl Net::SFTP module
      ... Now when I attempt to connect to a server outside ... Login completed, opening dummy shell channel. ... requesting shell. ... Requesting service subsystem on channel 1. ...
      (comp.lang.perl.misc)
    • [NEWS] Light Vulnerable to Remotely Exploitable Arbitrary Code Execution
      ... J.S. Connell has recently discovered that the IRC script for EPIC4 that J. ... S. maintains is vulnerable to an easy remote attack. ... can convince a user to join a channel whose name contains embedded EPIC4 ...
      (Securiteam)