

It can be very slow as they establish a new SSH connection for every operation performed. Net::SSH is just a wrapper around any SSH binary commands available on the machine. Handling interaction with a shell via Expect in a generic way just can not be reliably done. Using Net::SSH::Expect, in general, is a bad idea.
OPENSSH ORG INSTALL
It can be very difficult to install on some specific operating systems and its API is also limited, in the same way as Net::SSH::Perl. Net::SSH2 is much better than Net::SSH::Perl, but not completely stable yet.

Net::SSH::Perl is not well maintained nowadays (update: a new maintainer has stepped in so this situation could change!!!), requires a bunch of modules (some of them very difficult to install) to be acceptably efficient and has an API that is limited in some ways. Why should you use Net::OpenSSH instead of any of the other Perl SSH clients available? Then, every time a new operation is requested a new ssh process is started in slave mode, effectively reusing the master SSH connection to send the request to the remote side. When a new Net::OpenSSH object is created, the OpenSSH ssh client is run in master mode, establishing a persistent (for the lifetime of the object) connection to the server. That feature allows one to run several sessions over a single SSH connection (OpenSSH 4.1 was the first one to provide all the required functionality). This package is implemented around the multiplexing feature found in later versions of OpenSSH.

Net::OpenSSH is a secure shell client package implemented on top of OpenSSH binary client ( ssh). My ($rout, $pid) = $ssh->pipe_out("cat /tmp/foo") orĭie "pipe_out method failed: ". My ($rin, $pid) = $ssh->pipe_in("cat >/tmp/foo") orĭie "pipe_in method failed: ". My ($out, $err) = $ssh->capture2("find /root") ĭie "remote find command failed: ". $ssh->error ĭie "remote ls command failed: ". $ssh->error ĭie "remote command failed: ". Net::OpenSSH - Perl SSH client package implemented on top of OpenSSH SYNOPSIS use Net::OpenSSH ĭie "Couldn't establish SSH connection: ".
