[Ssh-sftp-perl-users] Unable to install Perl Module with cpan Repository on Linux
Brought to you by:
dbrobins
|
From: <moh...@wi...> - 2008-07-07 13:31:20
|
Hi All,
I want to install SSH module through cpan repository on linux, I
am getting the following error. But I can install the modules manually
by downloading the modules from cpan.org and using manual method.
cpan> install Net::FTP
Warning: Cannot install Net::FTP, don't know what it is.
Try the command
i /Net::FTP/
to find objects with matching identifiers.
Please help me to overcome this.
Thanks,
Mustafa
________________________________
From: Mohammed Mustafa (WT01 - Testing Services)
Sent: Wednesday, May 28, 2008 8:32 PM
To: 'ssh...@li...'
Subject: How to execute a perl script at remote server
Hi All,
I have written a Perl script, which deals with the ftp ing
(transferring) the file to remote server and executing a Perl script
(AUT) at remote m/c.
The script is as below and here I have 2 doubts, so please help me to
resolve this.
1) I am getting the message like "could not transfer the file to
server" but it is ftp ing the flie to remote m/c, and I can see that
file ( root1.txt ) there.
2) And I want to run the perl script (AUT) at remote m/c depending
on the data we sent, so could you please let me know how can I achieve
this.
Is it possible for me to do system("test.pl"), If I am at SFTP mode.
Please see comment line in the code below.
#!/usr/bin/perl -w
use strict;
use warnings;
use Net::SFTP;
my $server="A.BY.C.D";
my $user="roserag";
my $password="june@123";
my %args = (user => "$user", password => "$password", ssh_args => []);
$args{debug} = 1;
$args{user} = "root";
my $file="local.txt";
my $rfile = "root1.txt";
my $sftp=Net::SFTP->new($server, %args) or die "could not open
connection to $server\n";
$sftp->put($file,$rfile) or die " could not transfer the file to server
\n";
# system("test.pl"); Is this command work out.
exit;
[gaurav@testbrix Examples]$ perl sftp3.pl
testbrix.wipro.com: Reading configuration data /home/gaurav/.ssh/config
testbrix.wipro.com: Reading configuration data /etc/ssh_config
...................................
...................................
testbrix.wipro.com: sftp: In write loop, got 510 offset 0
testbrix.wipro.com: sftp: Sent message T:10 I:2
testbrix.wipro.com: sftp: Sent message T:4 I:3
could not transfer the file to server
But I can see the file
1,1 All
Regards,
Mustafa
|