rbm1213 has asked for the wisdom of the Perl Monks concerning the following question:
Here is the core of the code:Setting up drone tux20. tux-queen: Reading configuration data /home/queen/.ssh/config tux-queen: Reading configuration data /etc/ssh_config tux-queen: Connecting to tux20, port 22. tux-queen: Remote version string: SSH-2.0-OpenSSH_4.3p2 Debian-8ubuntu +1 tux-queen: Remote protocol version 2.0, remote software version OpenSS +H_4.3p2 Debian-8ubuntu1 tux-queen: Net::SSH::Perl Version 1.30, protocol version 2.0. tux-queen: No compat match: OpenSSH_4.3p2 Debian-8ubuntu1. tux-queen: Connection established. tux-queen: Sent key-exchange init (KEXINIT), wait response. tux-queen: Algorithms, c->s: 3des-cbc hmac-sha1 none tux-queen: Algorithms, s->c: 3des-cbc hmac-sha1 none tux-queen: Entering Diffie-Hellman Group 1 key exchange. tux-queen: Sent DH public key, waiting for reply. tux-queen: Received host key, type 'ssh-dss'. tux-queen: Host 'tux20' is known and matches the host key. tux-queen: Computing shared secret key. tux-queen: Verifying server signature. tux-queen: Waiting for NEWKEYS message. tux-queen: Enabling incoming encryption/MAC/compression. tux-queen: Send NEWKEYS, enable outgoing encryption/MAC/compression. tux-queen: Sending request for user-authentication service. tux-queen: Service accepted: ssh-userauth. tux-queen: Trying empty user-authentication request. tux-queen: Authentication methods that can continue: publickey,passwor +d. tux-queen: Next method to try is publickey. tux-queen: Trying pubkey authentication with key file '/home/queen/.ss +h/id_dsa' Connection closed by remote host. at /usr/local/share/perl/5.8.7/Net/S +SH/Perl/AuthMgr.pm line 142
I have tried this without the local $ssh , local $scp and undef $ssh and undef $scp commands, with the same results. Why can't I make SSH connections to multiple machines using Net::SSH::Perl?foreach $machine (@machine_name) { $cmd = "$drone_ssh"; { local $ssh; my %params; $params{"protocol"} = '2,1'; $params{"debug"} = '1'; $ssh = Net::SSH::Perl->new( "$machine", %params ); $ssh->login("$drone_user", %params); ( $stdout, $stderr, $exit ) = $ssh->cmd($cmd); undef $ssh; } if ( $exit == 0 ) { { # copy run files to drone local $scp; $scp = Net::SCP->new( "$machine", "$drone_user" ); foreach $filename (@files) { chomp( $target = $filename ); $scp->put( "$target", "$base_directory\/$work_directory\/" ) || ( $scp->{errstr} && print( $LF, "ERROR: scp $target to $machine: $scp->{errst +r}" ) ); } undef $scp; } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Net::SSH::Perl timeout
by sh1tn (Priest) on Dec 06, 2007 at 17:29 UTC | |
Re: Net::SSH::Perl timeout
by salva (Canon) on Dec 06, 2007 at 22:29 UTC | |
by rbm1213 (Novice) on Dec 07, 2007 at 04:09 UTC |