无法连接SFTP服务器,我也没有收到错误。 但脚本只是闪烁..等待服务器的一些响应..
Authentication methods that can continue: password,publickey.
Next method to try is password.
Trying password authentication.
Login completed, opening dummy shell channel.
channel 0: new [client-session]
Requesting channel_open for channel 0.
channel 0: open confirm rwindow 16384 rmax 16384
Got channel open confirmation, requesting shell.
Requesting service shell on channel 0.
channel 1: new [client-session]
Requesting channel_open for channel 1.
Entering interactive session.
Sending command: ls
Sending command: ls
Requesting service exec on channel 1.
channel 1: open confirm rwindow 16384 rmax 16384
use Net::SSH::W32Perl;
$ENV{HOME} = "C:\\user\\demo";
my $host = "xxx.xxx.xxxxx.xx";
my $ssh = Net::SSH::W32Perl->new($host, debug=>1);
$ssh->login('abcxxx', 'xxxxxxx'); # 30 seconds to login...why?!?!
my ($out, $err, $exit) = $ssh->cmd("ls");
print $out;