- 论坛徽章:
- 0
|
各位, 请帮我看看下面用来连F-Secure SSH server的代码为什么不成功?
环境: WinXP + ActivePerl5.8.7 Build813
use Net::SSH::W32Perl;
%params = ("debug",true);
$ssh = Net::SSH::W32Perl->new("192.168.0.168",%params, protocol=>2);
print "Start to login to remote SSH server...\n";
$ssh->login("ray","*ik,9ol.",1);
print "Login succeed!\n";
print "Begin to run remote command...\n";
print $ssh->cmd( 'ls -lA > ls.txt' );
运行之后, 如下显示:
gameplace: Reading configuration data C:\Documents and Settings\Ray/.ssh/config
gameplace: Reading configuration data /etc/ssh_config
gameplace: Connecting to 192.168.0.168, port 22.
gameplace: Socket created, turning on blocking...
gameplace: Remote version string: SSH-2.0-3.2.3 F-Secure SSH Windows NT Server
gameplace: Remote protocol version 2.0, remote software version 3.2.3 F-Secure SSH Windows NT Server
gameplace: Net::SSH: erl Version 1.30, protocol version 2.0.
gameplace: No compat match: 3.2.3 F-Secure SSH Windows NT Server
.
gameplace: Connection established.
gameplace: Sent key-exchange init (KEXINIT), wait response.
gameplace: Algorithms, c->s: 3des-cbc hmac-sha1 none
gameplace: Algorithms, s->c: 3des-cbc hmac-sha1 none
gameplace: Entering Diffie-Hellman Group 1 key exchange.
gameplace: Sent DH public key, waiting for reply.
gameplace: Received host key, type 'ssh-dss'.
gameplace: Host '192.168.0.168' is known and matches the host key.
gameplace: Computing shared secret key.
gameplace: Verifying server signature.
gameplace: Waiting for NEWKEYS message.
gameplace: Enabling incoming encryption/MAC/compression.
gameplace: Send NEWKEYS, enable outgoing encryption/MAC/compression.
gameplace: Sending request for user-authentication service.
gameplace: Service accepted: ssh-userauth.
gameplace: Trying empty user-authentication request.
gameplace: Authentication methods that can continue: publickey,password.
gameplace: Next method to try is publickey.
gameplace: Next method to try is password.
gameplace: Trying password authentication.
gameplace: channel 0: new [client-session]
gameplace: Requesting channel_open for channel 0.
gameplace: Entering interactive session.
Start to login to remote SSH server...
Login succeed!
Begin to run remote command...
gameplace: Sending command: ls -lA > ls.txt
gameplace: Requesting service exec on channel 0.
gameplace: channel 0: open confirm rwindow 100000 rmax 16384
然后就永远没下文了.
那位给看看啊 .
感激不尽! |
|