mantra2006 has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks


I have downloaded all the required modules. Currently there is
public/private key definition available to connect to
site and no username and password. How can I specify
key to Net::SFTP->new($host)
..looking for some help in this

Thanks & Regards
Sridhar

Replies are listed 'Best First'.
Re: SFTP using Net::SFTP
by marto (Cardinal) on Aug 24, 2006 at 19:39 UTC
    Did you read the Net::SFTP documentation? The answers to your question are there. If you Super Search this site you will find many examples for using Net::SFTP.

    Martin
Re: SFTP using Net::SFTP
by andyford (Curate) on Aug 24, 2006 at 20:10 UTC
    When you say that the "there is public/private key definition available", do you mean that you can use ssh from the command line and make the connection without a password?
    Make sure you test it this way.

    andyford
    or non-Perl: Andy Ford