写作提示时输入密码的批处理文件 [英] Writing a batch file that enters a password when prompted
问题描述
我写运行以下命令的批处理文件
I'm writing a batch file that runs the below command
SFTP的WinSCP://用户名:password@host.com:22 /privatekey=pgp530.ppk
winscp sftp://username:password@host.com:22 /privatekey=pgp530.ppk
的输出如下:
搜索主机...
连接至主机...
验证中...
使用用户名用户名。
用公钥进口-的openssh-键验证。
密码关键进口-的openssh-键
Searching for host... Connecting to host... Authenticating... Using username "username". Authenticating with public key "imported-openssh-key". Passphrase for key 'imported-openssh-key':
有什么办法有提示时,该批处理文件输入密码?谢谢!
Is there any way to have the batch file enter the passphrase when prompted? Thanks!
推荐答案
为什么不只是创建私钥没有密码,<一个href=\"http://stackoverflow.com/questions/112396/how-do-i-remove-the-passphrase-for-the-ssh-key-without-having-to-create-a-new-key/112409#112409\">or从私钥删除密码?
Why not just create a private key without a password, or remove the password from the private key?
这将是大致的明文密码传递给关键的安全。
It'll be roughly as secure as passing in a plain-text password to the key.
这篇关于写作提示时输入密码的批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!