Hello, Thanks for the suggestion. Yes I was able to instal Net::SFTP::Foreign and I was able to successfully connect to the server.
The place where I am stuck is when I try to do a 'Put'. I get the following message
put failed: the authenticity of the target host can't be established, +the remote host public key is probably not present on the '~/.ssh/kno +wn_hosts' file
The reason being that there seems to be an offending key in the ssh/known_hosts file , which has to be overidden.
I tried to do the same thing from the command line and I got the following result. From the command line , I can select the option "yes" for it to continue connecting to the server , but I do not know if I can do the same thing from the STP::Foreign module
Here is my command line output
sftp 2000550000506913@sftp.XXX.com@upload-itms6.XXX.com Warning: the ECDSA host key for 'upload-itms6.XXX.com' differs from th +e key for the IP address '152.125.77.44' Offending key for IP in /Users/punitpawar/.ssh/known_hosts:2 Matching host key in /Users/punitpawar/.ssh/known_hosts:7 Are you sure you want to continue connecting (yes/no)? yes 2000550000506913@sftp.XXX.com@upload-itms6.XXX.com's password:

In reply to Re^3: Need help in doing SFTP via command line by punitpawar
in thread Need help in doing SFTP via command line by punitpawar

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.