Re: [問題] SSH Module

看板Perl作者 (東大)時間15年前 (2008/10/05 17:43), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
※ 引述《b60413 (None)》之銘言: : 我寫了一個連接SSH的Client程式如下 : $ssh = Net::SSH::Perl->new('xxx.xxx.xxx.xxx'); : $ssh->login('name', 'pass'); : $ssh->cmd('logout'); : 這個程式可以正常的登入SSH 但是速度卻異常的慢 : 經過測試後發現是會卡在驗證那一段($ssh->login('name', 'pass')) : 請問這是正常的現象嗎? : 如果不是 應該要如何改才能夠加快登入的速度? : 謝謝 請問一下您是否曾遇到類似我這個問題 我的環境是winxp使用activePerl-5.8 我開啟Net::SSH::Perl的debug訊息如下 ======= Debug Message ======== 888tiger-48e401: Next method to try is publickey. 888tiger-48e401: Next method to try is password. 888tiger-48e401: Trying password authentication. 888tiger-48e401: Login completed, opening dummy shell channel. 888tiger-48e401: Next method to try is publickey. 888tiger-48e401: Next method to try is password. 888tiger-48e401: Trying password authentication. 888tiger-48e401: Login completed, opening dummy shell channel. 888tiger-48e401: channel 0: new [client-session] 888tiger-48e401: Requesting channel_open for channel 0. 888tiger-48e401: channel 0: open confirm rwindow 0 rmax 32768 888tiger-48e401: Got channel open confirmation, requesting shell. 888tiger-48e401: Requesting service shell on channel 0. 888tiger-48e401: channel 1: new [client-session] 888tiger-48e401: Requesting channel_open for channel 1. 888tiger-48e401: Entering interactive session. 888tiger-48e401: Sending command: logout 888tiger-48e401: Requesting service exec on channel 1. 888tiger-48e401: channel 1: open confirm rwindow 0 rmax 32768 看起來登入有成功,到下command時就一直卡在最後一行那邊,查了google 並沒有看到一個成功的解法 我的code如下 ===== code ===== use strict; use Net::SSH::W32Perl; my $SshHost = "192.168.1.201"; my $SshPort = "22"; my $SshDebug = 1; my $SshUserName = "root"; my $SshPassWord = 'password'; my $cmd; $ENV{HOME} = "c:/perl/mywork"; my $ssh = Net::SSH::W32Perl->new($SshHost, (Protocol => 2, port => "$SshPort", debug => "$SshDebug", interactive => 1) ); $ssh->login("$SshUserName", "$SshPassWord", 0); $cmd = "logout"; my ($out, $err, $exit) = $ssh->cmd($cmd); 有人遇過這樣的問題嗎?? -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 61.31.177.174
文章代碼(AID): #18w8mu3r (Perl)
討論串 (同標題文章)
本文引述了以下文章的的內容:
問題
1
2
完整討論串 (本文為第 2 之 2 篇):
問題
1
2
文章代碼(AID): #18w8mu3r (Perl)