my $ssh = Net::OpenSSH->new( '10.10.10.10', {user => 'abc', passwd => 'geheim'} ); print $ssh->capture('pwd'); # /home/abc/ $ssh->capture('cd /tmp'); print $ssh->capture('pwd'); # /home/abc/