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:
- user
- password
- debug
- ssh_args
Specifies a reference to a list of named arguments that should be given to the constructor of the Net::SSH::Perl object underlying the Net::SFTP connection.
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]
- options
Used to specify additional options to the configuration settings; useful for specifying options for which there is no separate constructor argument. This is analogous to the -o command line flag to the ssh program. If used, the value should be a reference to a list of option directives in the format used in the config file.
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"?
In reply to Net::SFTP using ssh_args woes by b10m
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |