05-15-2024 09:54 AM
Hello,
I'm trying to connect to a SFTP server using LabVIEW (LV2023). I'm using the SFTP APIs included in the VI.lib.
I am sure that the SFTP server is working fine. I can successfully connect using FileZilla.
In LV, the Connect.vi returns the following error:
************************************
Code: -5580899
set "LVASKPASS_PATH=\\.\Pipe\LOCAL\lvsshpw.<my Windows user>"& set "SSH_ASKPASS=C:\Program Files\National Instruments\LabVIEW 2023\resource\lvaskpass.exe"& set "SSH_ASKPASS_REQUIRE=force"& set "DISPLAY=:0"& "ssh" -p 22 -o StrictHostKeyChecking=accept-new -s <SSH user>@<SSH server> sftp
************************************
NOTE 1: In the error description above, I have removed some information for privacy reasons. Removed data is included in the '<' and '>' brackets.
NOTE 2: connection is password-based.
Can you help me?
Solved! Go to Solution.
05-15-2024 07:12 PM
Try if you can use OpenSSH for Windows from Power Shell or Windows Terminal SSH
05-16-2024 01:29 AM
With OpenSSH in Windows Powershell, I receive this error:
"PTY allocation request failed on channel 0"
Any idea?
05-17-2024 07:00 AM
Any suggestion? 😞
05-17-2024 07:19 AM - edited 05-17-2024 07:43 AM
From what I found for that error message, the server does not allow an interactive session. I guess that is required for password authentication from LabVIEW.
Does it work when you use sftp instead of ssh from the command line?
You can use key-based authentication instead of username/password. Here is an article how to set that up for a windows server: https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_keymanagement
You basically generate a key pair and put the public key into a file on the server. We use that approach with cRIOs.
05-17-2024 07:28 AM
I don't have any issues running SSH from PowerShell or CMD.
Perhaps you can try to search online.
I did a quick Google and found this. From ssh - How to fix request failed on channel 0 - Stack Overflow
The client is requesting a shell session with a TTY and the server is rejecting it. The server doesn't provide the client with a detailed reason why the request was rejected. You need to troubleshoot this on the server rather than the client.
01-19-2025 04:25 AM
No way to use the LabVIEW SFTP native library succesfully.
I solved the problem creating a wrapper of WINSCP.
01-19-2025 06:36 PM
@SlippinJimmy85 wrote:
No way to use the LabVIEW SFTP native library succesfully.
I solved the problem creating a wrapper of WINSCP.
https://winscp.net/eng/docs/library
Do you know for a fact that there is no way? It's probably more appropriate to say "I couldn't find a way" otherwise.