#!/usr/bin/perl -w use strict; use Net::SSH::Perl; use Net::SSH::Perl::Agent; use Net::SSH::Perl::Key; my $agent = Net::SSH::Perl::Agent->new(1); my $iter = $agent->identity_iterator; while (my($key, $comment) = $iter->()) {        ## Do something with $key. print ("Key: " , $key , ":" , $comment ,"\n"); print ("test\n"); print ("-----------------------------------------\n\n"); my $host = "iksa-hop1"; my $user = "daitdsi"; my $ssh = Net::SSH::Perl->new($host); $ssh->login($user); my $cmd = "ssh appsvc1 hostname"; my($stdout, $stderr, $exit) = $ssh->cmd($cmd); print ("-----------------------------------------\n\n"); print ("out: $stdout\n"); print ("-----------------------------------------\n\n"); print ("err: $stderr\n"); print ("-----------------------------------------\n\n"); print ("exi: $exit\n"); print ("-----------------------------------------\n\n"); } exit(0);