Specifying private key on PuTTY command-line

风流意气都作罢 提交于 2019-12-22 03:29:42

问题


I know there are simple commands to login to remote machine through VBA i.e. by specifying User@hostname and -pw option to provide the password in Wshell.Run function where Wshell is CreateObject("WScript.Shell").

However I need to use private key file (specified under Connection/SSH/Auth option in PuTTY) while logging in through Excel-VBA macro. Is there a way to do it?

I need it because I am using admin account on the second form of my VBA code (First form is using user's own account) and hence cannot provide the password textbox on the second form. Hence the only secure solution is to use SSH login through public and private key.

Thanks in advance!


回答1:


Use the -i switch to specify the private key.

putty.exe username@example.com -i mykey.ppk

See PuTTY command line documentation.



来源:https://stackoverflow.com/questions/37613132/specifying-private-key-on-putty-command-line

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