|
Posted by vhsr on August 25, 2006, 2:26 pm
Please log in for more thread options
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
|
| Similar Threads | Posted | | ANNOUNCE: Initial release of WSF/Perl (Perl bindings for a WS-* framework) | October 4, 2007, 1:37 am |
| PLJava - Perl embeded into Java (calling Perl from Java) - 1sr release - call for tests and review, please. | July 13, 2004, 4:06 am |
| Perl MakeMaker - how to force Perl linking with the static C library (libcrt.lib) instead of dynamic C library (msvcrt.lib) | April 17, 2007, 5:22 pm |
| MFC with Perl | July 19, 2005, 9:38 pm |
| Net::SSH::Perl | October 23, 2005, 11:16 pm |
| perl with ASP | November 9, 2005, 10:19 am |
| Perl | December 30, 2005, 9:28 pm |
| perl DBI help | March 1, 2006, 10:25 am |
| perl -> VB .NET | September 2, 2006, 11:17 pm |
| DBM and Perl | October 17, 2006, 9:11 am |
|