#!/usr/bin/perl -w use strict; use Net::OpenSSH; my $host = 'myhost.com'; my $user = 'myusername'; my $passwd = 'mypassword'; my $ssh = Net::OpenSSH->new($host, user => $user, passwd => $passwd); $ssh->error and die "Can't ssh to $host: " . $ssh->error; #my @ls = $ssh->capture("ssh myusername\@192.168.1.50"); #$ssh->error and # die "remote ls command failed: " . $ssh->error;