Hitarth1987 has asked for the wisdom of the Perl Monks concerning the following question:
Hi all, I am supposed to write a perl code that uses SFTP to transfer one file from my server to another server. The arguments are supposed to be read from a separate configuration file. The name of the config file is interface.cfg, and the name of the main perl file is interface.pl ---------- Configuration file format:
...# Ftp to machine - interface hash_ref_Ftp_address= <server address> hash_ref_Ftp_user= <user_id> hash_ref_Ftp_passwd= <password>
(Currently I am using FTP...) Now I want to make this into an SFTP with RSA key(s) included. How should I add the argument? ---------- Perl file format: I am currently taking parameters like these-
{$ FTP_address}->{FTP_user}=<value>Similarly I need to take keys as parameters from the configuration file. ---------- Execution: How would I create an SFTP connection and how would I log in? and How would I take keys as arguments? This are the commands I need to execute:
my $sftp = Net::SFTP->new($v_sftp_address, Debug => 1,..) $sftp->login($v_sftp_user, $v_sftp_passwd,..)
Do I only need to install Net::SFTP module for all this? I am a complete newbie so please help urgently !!!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Help required for SFTP code in Perl..urgent !!!
by ww (Archbishop) on May 24, 2011 at 04:28 UTC | |
|
Re: Help required for SFTP code in Perl..urgent !!!
by John M. Dlugosz (Monsignor) on May 24, 2011 at 04:29 UTC |