kishore
kishore

Reputation: 167

How can I FTP a file with an SSH key instead of a password, in Perl?

My local system and remote server is configured with ssh key exchange. and I want to get the XML files from the remote system with the NET::FTP packages. Can you suggest a way to do the file transfer with Net::FTP package, but without a password?

Upvotes: 2

Views: 811

Answers (1)

innaM
innaM

Reputation: 47849

I think you are looking for Net::SFTP.

my $sftp = Net::SFTP->new( 'some_host_name', { user => 'your_user_name' } );
$sftp->get( '/path/to/xml/file', '/local/path/to/xml/file' );

Upvotes: 4

Related Questions