Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re: Net::SSH2 Command Timeout Before Completion

by sierpinski (Chaplain)
on Jun 29, 2010 at 17:20 UTC ( [id://847159]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://847159]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-26 06:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found