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

I

IanW

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top