LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Telnet through SSH port

Does plink have a protocol switch?  If the SSH server says there is a "protocol missmatch" maybe we have to explicitly assign the SSH client protocol.  (I would've thought a plink tunnel would automatically take care of matching up the protocols, but maybe not.)
 
Can you find any failure logs on the linux test machine that report on the SSH server transactions?
 
0 Kudos
Message 11 of 25
(5,904 Views)
Unfortunately, I already tried that. I am basically using the plink command that you posted earlier, but I added the -ssh swich.
plink -ssh -pw mypasswd -L 9023:devmachine:22 user@devmachine

I also manually created the connection using putty to try it that way. It is definitely connecting to the machine I am targetting; I just can't effectively talk to it. I didn't mention this before, but I get the same server message when I connect with the Telnet vi's, but I never get the "Protocol mismatch." message that way.

Chris
0 Kudos
Message 12 of 25
(5,899 Views)
I even tried using other putty connection to test if the tunneling is ok. I noticed that the "new" putty i connect to localhost:54321(L54321 is tunneled to actual SSH server by putty). It asks for user and password. Does this mean we need to enable somsort of autologin, or do we need to login from LV Telnet/TCP exaple some how? Smiley Indifferent


-Janne
0 Kudos
Message 13 of 25
(5,890 Views)
Janne, you got my hopes up for a minute there Smiley Sad. When you said that it asked for a username and password, did you mean from putty? If it was from something in LabVIEW, that is fantastic. I just wrote a routine that could log me into a telnet server using the telnet vi's yesterday, and I imagine it would work pretty much the same way for an ssh server, if I could talk to one. I'm not sure exactly what you mean by the "new" putty, but I noticed you were using a port number that is much higher than the one RLD or I picked (54321) and I was hopeful that that made all the difference. Alas, I tried it, and had the same result.
0 Kudos
Message 14 of 25
(5,879 Views)
I meant it asked the login from putty. Smiley Sad
0 Kudos
Message 15 of 25
(5,864 Views)
I just ran across this thread. I know it may be too late to be useful to anyone but I may have some information to add.

The command:
plink -pw mypswd -L 4200:192.168.0.1:22 root@192.168.0.1

As has already been said this is going to forward all local traffic from port 4200 to port 22 on host 192.168.0.1 where the ssh server is listening.
This is in effect accomplishing nothing for us. Now we can access the server's ssh server at either 192.168.0.1:22 or 127.0.0.1:4200. LabVIEW cannot talk to the ssh server and the server terminates the connection.

LabVIEW can talk to a telnet server. So what needs to be done is start a telnet server on 192.168.0.1 that listens only on the localhost. Then tunnel that telnet port (usually 25) through plink. Then you can use LabVIEW to talk to the server.

For example:
1- Start a telnet server on the default port (25) on 192.168.0.1.
2- Tunnel this port:
plink -pw mypswd -L 4200:192.168.0.1:25 anyUserOtherThanRoot@192.168.0.1
3- Use the LabVIEW telnet VIs to talk to 192.168.0.1 through the tunnel by connecting to 127.0.0.1:4200.

Does this help? Does anyone care about this anymore? It's been a long time.
Message 16 of 25
(5,723 Views)
Yes! I care! This has been very helpful! Thank you very much Nathan Smiley Very Happy
Thoric (CLA, CLED, CTD and LabVIEW Champion)


0 Kudos
Message 17 of 25
(5,338 Views)
Okay so i've read through most of the NI forums for this. Does what you say NathanK work with using TCP calls through labview. Or do you need the networking package for labview? I'm building an automated test fixture for IP cameras. I've already written all the UPNP discovery and SOAP calls through UDP and TCP calls. What i need now is to connect to my network switch with telnet and run some CLI commands. So all i need is a simple send/recieve for telnet. I've only spent a day on this part so far and telnet is what i need to complete it. Any feedback would be great. Thanks.
- A minute saved is a Minute earned!
0 Kudos
Message 18 of 25
(5,212 Views)
This thread discussed how you can get LabVIEW to talk to an SSH server.

From your question it sounds like all you need is simple telnet functionality? The easiest way to get that is with the telnet VIs in the internet toolkit. Alternatively, if your telnet communication is going to be simple you can just use the TCP primitives. Telnet is ascii based and is easy to talk to.
0 Kudos
Message 19 of 25
(5,203 Views)

NathanK, Sorry to thread hijack. And yes all I needed was simple telnet without the toolkit. I figured it out today. One thing I cant figure out is how do you know when the telnet server is done sending data? what i did was read one byte at a time untill I time out. Then I can send my ascii back. Some of the commands to the server only require one byte. So would I create a listen port somehow to know if data is comming back? in case I type q and it quits on me or something to that nature. I've learned alot about tcp/UPnP/soap/udp/telnet this last month but I am still learning and could probably improve my code if I understood some more about it. Thanks for getting back to me.

 

p.s. I am intrested as to why you would want to open telnet then plink and port forward to use ssh? And why you couldn't just do simple tcp calls as well to a ssh server?

p.p.s. okay i see. labview cant ssh directly, so tunnel through telnet to a ssh server. then use telnet commands. 🙂


Message Edited by pRoFiT on 07-23-2008 02:22 AM
- A minute saved is a Minute earned!
0 Kudos
Message 20 of 25
(5,189 Views)