I
IanW
Hi
Has anyone tried connecting from a Linux box using Net::SSH:erl to a
Windows server running OpenSSH?
That is, I am testing using this script:
use Net::SSH:erl;
my $host = "10.10.10.10";
my $user = "username";
my $pass = "password";
my $ssh = Net::SSH:erl->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
Has anyone tried connecting from a Linux box using Net::SSH:erl to a
Windows server running OpenSSH?
That is, I am testing using this script:
use Net::SSH:erl;
my $host = "10.10.10.10";
my $user = "username";
my $pass = "password";
my $ssh = Net::SSH:erl->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