use Net::SSH::Perl; #use Net::SSH::Perl::Auth; my $host='172.27.90.48'; my $user='admin'; my $passwd='admin'; my $ssh = Net::SSH::Perl->new($host,port=>22,debug=>1); $ssh->login($user,$passwd); my ($stdout,$stderr,$exit) = $ssh->cmd("date"); $ssh->cmd("exit"); if($stderr){ print "ErrorCode:$exit\n"; print "ErrorMsg:$stderr"; } else { print $stdout; } exit $exit; james@trail:~/perl$