Web ページから別のサーバーで perl スクリプトを開始しようとしていますが、plink に問題があります。IUSR_ ユーザーから実行すると、ホスト キーが記憶されていないようです。
私はこの問題を軽減することができました:
print "Content-Type:text/plain\n\n";
open(PLINK, "| \"C:\\Program Files\\PuTTY\\plink.exe\" -pw sanitized Administrator\@serveurftp.a.b.c whoami") or die "Can't fork: $!";
sleep(1);
print PLINK "y\n";
close(PLINK);
このスクリプトを Web ページから呼び出すと、常に次のようになります。
The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 cb:eb:dc:1b:9e:1c:6b:fa:63:fb:2e:ba:2c:61:26:c4
If you trust this host, enter "y" to add the key to
PuTTY's cache and carry on connecting.
If you want to carry on connecting just once, without
adding the key to the cache, enter "n".
If you do not trust this host, press Return to abandon the
connection.
Store key in cache? (y/n) serveurftp\administrator
これは初回のみ取得し、その後は「serverurftp\administrator」のみ取得する必要がありますが、IIS から実行した場合、plink はホスト キーを保存できないようです。
これを回避する方法について何か考えがありますか?