2012-07-23 76 views
2

無法登錄到機器......但使用相同的憑據,我可以登錄到機器無法ssh到遠程機器

my $ssh = Net::SSH::Expect->new (host => "9.118.46.36", password=> 'test01', user => 'root', raw_pty => 1, timeout => 20); 

    # establishes the ssh connection, 
    # authenticating with that user and password 
    $ssh->login(); 

SSHAuthenticationError登錄超時。輸入流目前有以下內容:[email protected]的密碼:在/usr/local/share/perl/5.14.2/Expect.pm線828

+0

是本機訪問使用SSH的殼呢? – snoofkin 2012-07-23 17:38:23

回答

0

我增加了超時到30,它的工作原理... 有沒有什麼辦法來檢查應該是什麼時候了。 隨着系統負荷增加超時30也可能無法工作。

+1

這不是一個很好的解決方案,以增加超時。應該有一種方法可以動態地做到這一點。 – Joe 2012-07-23 15:48:38