#!/usr/bin/perl use strict; use warnings; use 5.010; system('cls'); say "bin in Zeile ".__LINE__; use Net::OpenSSH; $Net::OpenSSH::debug = ~0; # alle debugging flags einschalten https://metacpan.org/pod/Net::OpenSSH#DEBUGGING say "bin in Zeile ".__LINE__; my $ssh = Net::OpenSSH->new('host .com', user => 'user', password => 'pw' ); say "bin in Zeile ".__LINE__; $ssh->error and die "Couldn't establish SSH connection: ".$ssh->error; say "bin in Zeile ".__LINE__; my ($out,$err) = $ssh->capture2({timeout => 5},"cd /www/verz") or die "remote command failed: ".$ssh->error; print "THE OUT IS $out\nTHE ERROR IS $err\n"; say "bin in Zeile ".__LINE__;