in reply to Net::SSH2 Command Timeout Before Completion

Take a look at Net::SSH::Expect... I use it quite a lot, and it works really well. It has configurable timeouts for connections, and many other options. Below is an example from one of my scripts:
my $ssh = Net::SSH::Expect->new ( host => "$serverlist[$host]", user => "$user", raw_pty => 1, restart_timeout_upon_receive => 1, timeout => 5, ssh_option => " -x -o ConnectTimeout=4", log_file=> "/tmp/$serverlist[$host].log", );
One difference is that this module expects to use an SSH key instead of an interactive password. I don't know if that's an issue for you or not.

Replies are listed 'Best First'.
Re^2: Net::SSH2 Command Timeout Before Completion
by taim (Initiate) on Jun 29, 2010 at 23:56 UTC

    I will be using a key eventually (I hope). I will give it a bit of a test. Thanks.