Dear Monks o' Knowledge,

I'm currently messing with Net::SFTP and stumbled across something I don't quite get. I would value your opinions on this.

Because this server runs Apache as user nobody, I would like to disable the StrictHostKeyChecking (read: write to ~/.ssh/known_hosts) for "nobody" is set up to use "$HOME = /".

So far so good! I thought when I saw this in the PODs:


perldoc Net::SFTP

USAGE
Net::SFTP->new($host, %args)
%args can contain:

perldoc Net::SSH::Perl

BASIC USAGE

Usage of Net::SSH::Perl is very simple.
Net::SSH::Perl->new($host, %params)

new accepts the following named parameters in %params:
[snip]

Now how would I tell %args in Net::SFTP->new($host, %args) to usethis options => "StrictHostKeyChecking no"?

I've tried things like the following to no avail:

my %args = (user => $user, password => $pass, debug => 1, ssh_args => (options => "StrictHostKeyChecking no") ); my $sftp = Net::SFTP->new($host, %args)

Update: Basically, my question is: what is meant with "a reference to a list of named arguments"?

--
b10m

In reply to Net::SFTP using ssh_args woes by b10m

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.