Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Just to clarify, you seem to be asking about two different things. FTP over SSH (SFTP) and FTP with SSL. They are both FTP transfers (essentially) but the first tunnels FTP through the SSH protocol whereas the second uses SSL with the FTP transfer. FTP w/SSL uses SSL certificate authentication (along with user ID/password if configured that way). FTP over SSH uses public/private keys for authentication (this can be configured to use only key-auth, or key-auth plus user/password auth).

If you are planning to use FTP over SSH with public/private keys, you need to set up the private SSH key on the source machine, then export the public SSH key and upload it to the correct location on the destination machine. This is over and above whatever Perl you code and would allow the Perl code to authenticate to the remote server. As others have said, there are modules on CPAN for this sort of thing.

If you are planning to use FTP w/SSL, then you need to get a copy of the SSL certificate for the site (there are several ways to do this, from having the site admin send it to you, to copying it out of IE or whatever browser you might be using or pointing your script to the correct local SSL cert to use. I'm not 100% fluent in the ins and outs of SSL cert authentication from a client side perspective. I've set it up and gotten it working on the server side but that's about it. The last I looked, there really wasn't anything in CPAN for handling FTP w/SSL (that could have changed) but you might look at the Net::FTP and and SSL modules that are out there for direction.

I would suggest figuring out which protocols you are planning to use (FTP over SSH aka SFTP or FTP with SSL aka FTPS) then look for modules on CPAN.


In reply to Re: SFTP with SSH in perl by nimdokk
in thread SFTP with SSH in perl by satheya

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others romping around the Monastery: (8)
    As of 2014-09-16 22:34 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      How do you remember the number of days in each month?











      Results (51 votes), past polls