用Putty命令行PSFTP.exeinput私钥密码

我正在使用psftp.exe来自动下载文件,但需要使用私钥连接,如下所述。 我可以连接,但是,私钥需要密码。

这个程序的工作原理,但我必须从键盘input密码,从命令行运行的过程失败。 我想知道是否有人能告诉我如何在命令行中发送密码。

Using Putty's PSFTP.exe With A Private Key Command Line: c:\putty\psftp.exe [email protected] -i putty_id_rsa_1024.ppk -bc:\putty\myscript.scr Command Line Notes: Replace username with your login name and modify the "putty_id_rsa_1024.ppk" key name to match your key. In order to use a key, you will need to use puttygen.exe to generate, import, and or export your keys. PuTTY requires a putty key file to make a private key connection. myscript.scr file contents: cd / put File1.txt put File2.txt put File3.txt close Script Notes: Each command is a standard Unix navigation command. 

如上所述,谁能告诉我如何在命令行中发送私钥密码?

为什么不从密钥中删除密码? 如果您只是将密码保存在configuration文件或脚本的某个位置,则在密钥上使用密码没有任何价值。

只需用puttygen加载你的ppk文件,删除密码并保存。

您当然可以制作您的ppk的副本,并从该副本中删除该短语,然后使用文件系统ACL保护该副本,以最大限度地降低风险。

您可以在login时将密钥加载到分页中,并只提供一次密码。 只要pageant正在运行,那么所有psftp / PuTTy / plink连接将使用存储在其中的密钥。