0

I try to establish a SSH-connection via VBA and the Windows-Shell-command.

If I manually open the Windows-command line (cmd.exe) and put

ssh -i 'C:\Temp\MySecureKey_SSH.pem' ec2-user@X.XX.XXX.XXX

the connection will be established as wished. But every try to pass this command from VBA lost. Even it was not possible to open the command line via VBA and change there to the OpenSSH directory. The named directory will not be shown on a command line created via VBA:

strCMD = "cmd.exe /S /K " & Chr(34) & "C:\Windows\System32\OpenSSH\ssh.exe" & Chr(34)
PID = Shell(strCMD, vbMaximizedFocus)

To give you a better understanding for what I need this: the final aim is to pass commands via SSH to a easyrsa3 instance (https://github.com/OpenVPN/easy-rsa/). As creating a new client certificate is very uncomfortable (different steps to go) it would be great to simplify that via VBA (create new client certificate, copy certificate to a certain directory, copy certificate via scp to the local PC, generate an OpenVPN-config-file with the certificates).

0 Answers0