I have two nodes that are set up with mutual RSA keys. I can SSH and SFTP freely between them, bilaterally, password-less.I can also SFTP between then with Perl Net::SFTP using host and user and pass.

Now I want to add Foreign, and transmit between them without a password. I'm currently trying:

my $ftph; eval { $ftph = Net::SFTP::Foreign( "$user\@$host", more=>'-v', autodie=>0 ); };
after this step, $ftph is undef, and $! = 'Inappropriate ioctl for device'. And of course $ftph->error is undef as well.

If I try sftp user@host at the commandline, the SFTP connection is made successfully with no password, and it drops to the SFTP> prompt.

All of the examples I can find using ::Foreign , as well as the metacpan page, pretty much just start with this same expression, more or less. But I wonder, am I suppposed to establish an SSH pipe first with Perl BEFORE this step, but the examples don't show that step? I did see some examples that had use IO::Pty; , but there was no further calls to that class before the Net::SFTP::Foreign line.

Without the eval {} , the step dies with no message at all.

I also added $Net::SFTP::Foreign::debug = -1; but it didn't seem to produce any additional output.

Advice, tips, and guidance are most appreciated.

In reply to trying to get Net::SFTP::Foreign to work by misterperl

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.