LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using LabView to SSH to a remote Linux unit

I need to remotely connect to a Linux machine using SSH

 

IP: 192.168.5.xx,

Port: 22

User: *****

Password: *****

 

Then then I want to send some commands "lsusb[...]" and "sudo lspci[...]", and read back the responses.

 

Are there any prewritten vi's for this, or can anyone share what they have done to overcome this?

LABOR OMNIA VINCIT
0 Kudos
Message 1 of 4
(123 Views)

There are a couple of SSH packages in VIPM. I haven't tried them myself though.

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 4
(82 Views)

I've used the Putty command-line tools for this in the past.

https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

 

The device we were talking to needed some RSA keys for security, and the customer was able to provide .ppk files designed for Putty.

 

The command line for SSH w/ security keys was (example):

@echo OFF
echo n | "C:\Program Files\PuTTy\plink.exe" -i "C:\SSH\keys.ppk" root@192.168.1.2 echo "Hello World!"

 

Or without all the security key stuff:

@echo OFF
"C:\Program Files\PuTTy\plink.exe" root@192.168.1.2 echo "Hello World!"

 

 

There's also a command line tool for SCP file transfer, example:

@echo OFF
echo n | "C:\Program Files\PuTTy\pscp.exe" -scp -i "C:\SSH\keys.ppk" "C:\SSH\filetocopy.txt" root@192.168.1.2:/root/scripts/filetocopy.txt

 

It looks like they added native SSH into LabVIEW in version 2021. I've never played with it -- we are still on 2019 and I believe Putty was NI's recommended method back then.

0 Kudos
Message 3 of 4
(80 Views)

LabVIEW 2021 includes support for SFTP and SSH. You can find the palettes under Data Communication >> Protocols.

 

0 Kudos
Message 4 of 4
(46 Views)