Writing a batch file that enters a password when prompted

给你一囗甜甜゛ 提交于 2019-12-25 01:58:01

问题


I'm writing a batch file that runs the below command

winscp sftp://username:password@host.com:22 /privatekey=pgp530.ppk

The output is as follows

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!


回答1:


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.



来源:https://stackoverflow.com/questions/7110894/writing-a-batch-file-that-enters-a-password-when-prompted

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!