LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Does anybody have any experience on generating SSH key in Labview?

I'm developing a tool in Labview and this tool needs to generate SSH key then copy them out. I don't see a function in Labview that can generate SSH key pairs. I've tried external programs puttygen.exe and ssh-keygen. None of them are ideal solutions. Because puttygen needs mouse and button press interactions (user interface) and ssh-keygen needs cygwin installation. 

 

Does anyone have any better ideas?  

 

Thanks very much!

 

 

0 Kudos
Message 1 of 17
(3,432 Views)

Believe OpenSSL can do that, all terminal-based... can use the system_exec.vi to call openssl.

0 Kudos
Message 2 of 17
(3,427 Views)

Thank you for your response!

 

I just tried genrsa in openSSL and it seems that genrsa only generates a private key. How do I use openSSL to generte a SSH key pair including a private key and a public key? What will be the command line look like if I want to specify it to run quietly (i.e. no screen printing), specify the key size (to 1024), specify the file name and specify the password? I'm not familiar with this tool, if you can give me a little more detailed help, I'd really appreciate it.

 

Thanks a lot!

0 Kudos
Message 3 of 17
(3,415 Views)

@Labveiw User wrote:

Thank you for your response!

 

I just tried genrsa in openSSL and it seems that genrsa only generates a private key. How do I use openSSL to generte a SSH key pair including a private key and a public key? What will be the command line look like if I want to specify it to run quietly (i.e. no screen printing), specify the key size (to 1024), specify the file name and specify the password? I'm not familiar with this tool, if you can give me a little more detailed help, I'd really appreciate it.

 

Thanks a lot!


Generally the place that you download this software will offer this type of help.

0 Kudos
Message 4 of 17
(3,409 Views)

http://www.openssl.org/docs/

That's probably the best place to start.

0 Kudos
Message 5 of 17
(3,407 Views)

Thanks very much for your help! I followed the link and was able to find all the related documents. I read them and followed the instructions and syntax. However it seemed that the keys generated didn't work. Due to time constrain, I've decided to stick with ssh-keygen. Again, I appreciate all your responses and help!

 

Regards.

0 Kudos
Message 6 of 17
(3,375 Views)

I have another question:

 

I used ssh-keygen with System Exec.vi. The code works fine on my XP machine. But it doesn't work on windows 7 enterprise machine. It seems that windows 7 has different security settings. But I tried to use different location for the working directory for System Exec.vi and it still wouldn't work.

 

I've attached a snapshot of my code here. I even tried to just have ssh-keygen in the command line and it didn't work either.

 

Does anyone have any ideas?

 

Thanks very much!

0 Kudos
Message 7 of 17
(3,337 Views)
0 Kudos
Message 8 of 17
(3,328 Views)

The double quote at the end of the command string looks suspect to me!

Rolf Kalbermatter
My Blog
0 Kudos
Message 9 of 17
(3,312 Views)

Rolf,

 

That was not a double quote. They were two Apostrophe marks. Yeah, I know it looks like a double quote.

 

Like I said, the code works fine on XP machine. On Windows 7 machine, the command I had there works in Cygwin window if you manually type in. It's just that it doesn't work with System Exec. vi in Labview. Any idea? Can anybody help please?

 

Thanks very much!

0 Kudos
Message 10 of 17
(3,302 Views)