Help with Net::SSH::Perl



Hi

Have any of you run into any issues like the one I am
having running the Net::SSH::Perl module? I installed
it without any issues following recommendations for
pre-requisites. I turned on debugging, and it is
stopping ssh connection at this point:

Connection closed by remote host. at
/usr/local/lib/perl5/site_perl/5.8.8/Net/SSH/Perl/AuthMgr.pm
line 43

The script I have is this:

#!/usr/local/bin/perl -w

@F5 = ( 'devicename' );
@ident = ( '/.root/.ssh2/root_system' );
%args = ( port => 22, protocol => 2, identity_files =>
\@ident, debug => 1);
%sftp_args = ( ssh_args => [%args] );
$workdir='/myfiles';

use Net::SSH::Perl;
use Net::SFTP;

foreach $bigip ( @F5 ) {

my $conn = Net::SSH::Perl -> new(
"$bigip.domain.com", %args );
$conn -> login('root');
( $stdout, $stderr, $exit ) = $conn -> cmd('bigpipe
config save /root/backup/
`hostname`-`date +%m%d%y%H%M`');
#
print "\$stdout: $stdout!\n\$stderr:
$stderr!\n\$exit: $exit!\n";
if ( ($stderr =~ m/config save request.../) && (!
$exit ) ) {
( $stdout, $stderr, $exit ) = $conn -> cmd('ls
/root/backup');
chomp $stdout;
$conn -> cmd('exit');
my $sftp = Net::SFTP -> new("$bigip.domain.com",
user => 'root', %sftp_ar
gs);
$sftp -> get("/root/backup/$stdout",
"$workdir/$stdout");
$sftp -> do_remove("/root/backup/$stdout");
}

--

I copied the public key from my system to device, I
can ssh from command line to device fine using the
keys, but I am having problem automating the process
via the script above. The script works fine on another
system I inherited (do not know what else could have
been modified, etc).

help is greatly appreciated.

Thanks

Running Solaris 9 on sparc server

.



Relevant Pages

  • Re: SSH problem Host key authentication failure
    ... For any of the affected users? ... And is apache's public key in the nitin's authorized_keys? ... > trying to SSH to the remote machine from within a script. ... >> To be notified of updates to the web site, ...
    (RedHat)
  • Re: Digital signature with Javascript
    ... > then checked by my script and the username given on login and the one ... other implementations have stub code invoking radius code (radius code ... authentication) for authentication. ... past posts of public key enhancements for radius: ...
    (sci.crypt)
  • Re: HELP cant get host-based authentication to work!
    ... > server on an untrusted network. ... I want the script to run under a certain ... > instructions are calling this host-base authentication. ... a user authenticating with that public key is only allowed to run ...
    (comp.security.ssh)
  • RE: how to give password for ssh connection from shell script
    ... You can even use expect to create an interactive ssh session with ... Subject: AW: how to give password for ssh connection from shell script ...
    (RedHat)
  • Term::ReadKey not working on one linux box
    ... Making a ssh connection from this computer to another one, and executing ... broken machine and executing the script doesn't work. ...
    (comp.lang.perl.misc)