I tried to use proxy via script like this:
my $sftp = Net::SFTP::Foreign->new(
host => $server,
user => $user,
password => $password,
more => [-o => "ProxyCommand ./proxify.pl --host %h --port %p" ]);
and found that remote server responses:
"The authenticity of host 'host.com (<no hostip for proxy command>)'
can't be established...RSA key fingerprint is
eb:30:ce:1a:...3a:0a:c6:27:60...Are you sure youwant to continue
connecting (yes /no)?"
And ufter that the Net::SFTP::Foreign fall down with error:
"unless the authenticity of the target host can't be established, the
remote host public key is probably not present on the
'~/.ssh/known_hosts' file"
----
Also I tried manually connect to host.com (fo reason if insertion public
key to known_hosts). but nothing changes. Maybe it some issue with ssh
when using proxy, don't know.
So I propose to add parameter to say 'yes' to pty
see attached diff file for Net::SFTP::Foreign::Backend::Unix module.
Subject: | Unix.diff |
223a224
> my $force_auth = delete $opts->{force_auth};
293c294,300
< $sftp->_conn_failed("the authenticity of the target host can't be established, " .
---
>
> if ($force_auth and $buffer =~ /\?$/) {
> print $pty "yes\n";
> next;
> }
>
> $sftp->_conn_failed("the authenticity of the target host can't be established, " .