foreach $host (@HOSTS) {
$ssh = Net::SSH::Perl->new("$host",debug=>1,options => ["ConnectTimeout=5","StrictHostKeyChecking=no"]);
$ssh->login($user);
($out, $err, $exit)=$ssh->cmd($exec_cmd);
}
####
Host host2
hostname host2.mydomain
User user1
####
my_host: Reading configuration data /home/djones/.ssh/config
my_host: Reading configuration data /etc/ssh_config
my_host: Connecting to host2, port 22.
my_host: Remote version string: SSH-2.0-OpenSSH_5.3p1 Debian-3ubuntu7.1
my_host: Remote protocol version 2.0, remote software version OpenSSH_5.3p1 Debian-3ubuntu7.1
my_host: Net::SSH::Perl Version 1.36, protocol version 2.0.
.y_host: No compat match: OpenSSH_5.3p1 Debian-3ubuntu7.1
my_host: Connection established.
my_host: Sent key-exchange init (KEXINIT), wait response.
my_host: Algorithms, c->s: 3des-cbc hmac-sha1 none
my_host: Algorithms, s->c: 3des-cbc hmac-sha1 none
my_host: Entering Diffie-Hellman Group 1 key exchange.
my_host: Sent DH public key, waiting for reply.
my_host: Received host key, type 'ssh-dss'.
my_host: Host 'host2' is known and matches the host key.
my_host: Computing shared secret key.
my_host: Verifying server signature.
my_host: Waiting for NEWKEYS message.
my_host: Send NEWKEYS.
my_host: Enabling encryption/MAC/compression.
my_host: Sending request for user-authentication service.
my_host: Service accepted: ssh-userauth.
my_host: Trying empty user-authentication request.
my_host: Authentication methods that can continue: publickey,password.
my_host: Next method to try is publickey.
my_host: Publickey: testing agent key '/home/djones/.ssh/id_dsa'
my_host: Authentication methods that can continue: publickey,password.
my_host: Next method to try is publickey.
my_host: Next method to try is password.
my_host: Trying password authentication.
my_host: Will not query passphrase in batch mode.
my_host: Authentication methods that can continue: publickey,password.
my_host: Next method to try is publickey.
my_host: Publickey: testing agent key '/home/djones/.ssh/id_dsa'
my_host: Authentication methods that can continue: publickey,password.
my_host: Next method to try is publickey.
Received disconnect message: Too many authentication failures for djones
at /usr/share/perl5/vendor_perl/Net/SSH/Perl/AuthMgr.pm line 143.