#!/opt/homebrew/bin/perl # # ssh -v -o "IdentityFile=$HOME/.cmvtools/toolauth" new-mac-mini # use strict; use warnings; use Net::SSH::Perl; my $host="new-mac-mini"; # FAILS #my $host="craigs-mac-mini"; # WORKS my $cmd="ls -las /"; my $user="cmv"; my $ssh = Net::SSH::Perl->new($host, debug=>1, protocol=>2, interactive=>0, identity_files =>[ "/Users/cmv/.cmvtools/toolauth" ], ); $ssh->login($user); my($stdout, $stderr, $exit) = $ssh->cmd($cmd); print "stdout=$stdout\n"; print "stderr=$stderr\n"; print "exit=$exit\n";