SSH, Telnet and Other Remote Login and Commands Execution Protocols in Perl
Introduction
This page will describe how to use Perl to execute commands on remote hosts using common Internet protocols such as Telnet or the more modern and more secure SSH (Secure Shell). We are getting asked about these things a lot.
Telnet
Net-Telnet
Net-Telnet allows one to run a Telnet session from within Perl and to interact with it.
SSH (Secure Shell)
In SSH, the CPAN landscape is somewhat more hazy with many alternatives. Some of the commonly mentioned ones are:
- Net-SSH-Perl
- Net-OpenSSH
- Net-SSH2
- IPC-PerlSSH and IPC-PerlSSH-Async which is similar, but works with Net-Async.
You should try some of them (or all of them) and see which one works the best for you.