08-23-2010 09:22 AM
Hello,
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.
08-23-2010 10:08 AM
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.
08-23-2010 10:12 AM
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. 😛
08-23-2010 11:57 AM
Can you accept the key manually and then use the LabVIEW -batch trick?
Ton
08-23-2010 01:09 PM
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.
08-23-2010 02:23 PM
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.
08-23-2010 02:41 PM
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.
Ton
08-29-2010 03:03 PM
I don't have full solution, but I was reading this on Stackoverflow.
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.
Ton
01-20-2012 09:49 AM
echo yes | plink -agent -pw 123 -m VMinfo.sh root@164.99.95.65
Above command will auto accepte certificate.
01-10-2013 12:19 AM
Hello, All
Anybody can tell me how to resolve this,thanks
Don't want to get prompt when login name with password.