#!/usr/bin/perl use strict; use warnings; use Net::SSH::Perl; use Net::SSH::Perl::Cipher; my $host = 'localhost.localdomain'; my $username = 'yourusername'; my $password = 'yourpassword'; my $cmd = 'perl -V'; warn "Starting SSH Services..."; my $ssh = Net::SSH::Perl->new($host, debug => 1); print "Done\n"; warn "Logging in..."; $ssh->login($username, $password); print "Done\n"; warn "Starting command..."; my($stdout, $stderr, $exit) = $ssh->cmd($cmd); print $stdout, "\n";