Through LabVIEW's systemexec.vi, I am using PuTTy's command line interface, plink, to access information and change settings automatically on a remote Linux computer through Secure SHell.
When using plink through systemexec.vi, all user prompts that are normally generated in a MS-DOS command line interface are supressed. Keep this in mind.
When using SSH, upon first connection you are required to verify a service host key in order to make a connection. Through plink, the command line will generate a prompt, asking the user to "accept service host key? (y/n)".
So my problem is that systemexec.vi will run plink, but i cant figure out a way to automatically accept the host key. All i need is for LabVIEW to recognize the prompt returned from plink and enter a "y" value.
Please let me know if this is confusing. I tried my best to explain my problem in a way that everyone can understand, but if I did a bad job, please allow me to rephrase myself.
Thank you to everyone who has any ideas at all.
Based on the plink documentation, it looks like you can just add the -batch flag to your command line and you won't be prompted to accept the host key.
Thanks for the response.
You are correct, it does not prompt for the key. The problem is that it also doesn't accept the key. It just represses the prompt. 😛
Thank you for the response.
Yes, accepting the key manually possible, and is where I am at right now. But the automation program won't really be fully automated if it requires the user to do steps manually. It wont be "bad" to do it manually, but it isn't good either.
If, in the end, the manual option is the only way to accept the key, then I will be ok with that. I just want to try to elliminate the possiblity for error, and create more consistant results regardless of the user's level of computer experience.
PuTTY should also have a way for you to add the host key to the Windows Registry. This should either prevent the prompt entirely or allow the -batch mode to proceed with the valid key.
I haven't worked too much with PuTTY but for other SSH clients I've worked with, getting the right key was not too difficult and is probably the recommended method from a security perspective.
there is a -i option to use a local file, I don't know what that means.
-i key private key file for authentication
There is a specific section in the plink manual about Automated Connections.
Not really helpful to me , but a question on a non-LabVIEW specific forum might be a better help point.
It's mainly about Mercurial but it points to a site on the Mercurial help page on ssh'ing.
It's using the following command:
plink -ssh -i "C:/path/to/key/id_rsa.ppk" -C -agent
So you need to get a private key that is accepted by the server, call plink with the -i and the file (I'm not positive you will need forward slashes), the -Agent tells plink to use a pageant (?) and not an interatively GUI.
echo yes | plink -agent -pw 123 -m VMinfo.sh firstname.lastname@example.org
Above command will auto accepte certificate.
Anybody can tell me how to resolve this,thanks
Don't want to get prompt when login name with password.