Net::SSH::Perl -> OpenSSH on Windows Server?

Discussion in 'Perl Misc' started by IanW, Jun 20, 2007.

  1. IanW

    IanW Guest

    Hi

    Has anyone tried connecting from a Linux box using Net::SSH::perl to a
    Windows server running OpenSSH?

    That is, I am testing using this script:

    use Net::SSH::perl;
    my $host = "10.10.10.10";
    my $user = "username";
    my $pass = "password";
    my $ssh = Net::SSH::perl->new($host, (debug => 1));
    $ssh->login($user, $pass);
    my $cmd = 'dir';
    my($stdout,$stderr,$exit) = $ssh->cmd($cmd);
    print "stdout=$stdout \nstderr=$stderr \nexit=$exit\n";

    The debug lines I get seem to indicate a successful connection (not copied
    all the lines as there are alot):

    timberwindows.com: channel 1: new [client-session]
    timberwindows.com: Requesting channel_open for channel 1.
    timberwindows.com: Entering interactive session.
    timberwindows.com: Sending command: dir > c:\TW.com\zzzzzz.txt
    timberwindows.com: Requesting service exec on channel 1.
    timberwindows.com: channel 1: open confirm rwindow 0 rmax 32768
    timberwindows.com: input_channel_request: rtype exit-status reply 0
    timberwindows.com: channel 1: rcvd eof
    timberwindows.com: channel 1: output open -> drain
    timberwindows.com: channel 1: rcvd close
    timberwindows.com: channel 1: input open -> closed
    timberwindows.com: channel 1: close_read
    timberwindows.com: channel 1: obuf empty
    timberwindows.com: channel 1: output drain -> closed
    timberwindows.com: channel 1: close_write
    timberwindows.com: channel 1: send close
    timberwindows.com: channel 1: full closed
    stdout=
    stderr=
    exit=255

    As one can see $stdout contains nothing.. it works fine if I Putty into the
    Linux box and use the ommandline ssh utility to connect to the Windows
    servers. I guess this is not really a Perl issue but maybe it's something to
    do with the module? Any ideas?

    Thanks
    Ian
     
    IanW, Jun 20, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. loial
    Replies:
    0
    Views:
    429
    loial
    Feb 3, 2009
  2. loial
    Replies:
    0
    Views:
    422
    loial
    Feb 10, 2009
  3. Ryan Grow
    Replies:
    1
    Views:
    193
    Young Hyun
    Sep 29, 2008
  4. Tench Johnson
    Replies:
    1
    Views:
    318
    Biff Tannen
    Apr 23, 2010
  5. salamond

    net/ssh in ruby. ssh.exec fails

    salamond, Feb 17, 2011, in forum: Ruby
    Replies:
    0
    Views:
    268
    salamond
    Feb 17, 2011
Loading...

Share This Page