Connecting to UNIX from WinNT to run app, and colect data. Best way ??

I wanna write a WinNT app that connect to UNIX then run a UNIX app. The UNIX app will print data to standard output (the screen, if I use telnet). I want the WinNT app to collect these data.

I am thinking of the WinNt app to connect to UNIX via a Telnet port. But is this the BEST way to do this job ????

(1) Is there a better way ?
(2) Better protocol than Telnet, maybe ?
(3) Any libraries to make Telnet easier to program ??? Under WinNT ??? I cant seems to find any.


Who is Participating?
chris_calabreseConnect With a Mentor Commented:
You can get Telnet to work pretty easily for your task.  Since the telnet protocol is extremely simplistic, you don't need any special software to drive it.  Anything that can open a socket connection will do.  The _easiest_ way to do this is probably to ride on top of 'netcat' (try, which is a utility for setting up sockets without having to know about sockets programming.

There are some big security drawbacks to Telnet, however.  First, you send the password in the clear.  Second, the fact that you send a password at all means you need to store one in your program (or the registery, etc.).

Another possibility is 'rsh', or Remote SHell, which authenticates by user-name and IP address rather than by password.  Whether this is actually more or less secure depends on a number of factors like how hard it is to spoof IP addresses in your environment, and I wan't get into them all here.  Rsh (which sits on the rcmd authentication protocol) is a bit trickier to program, and there are no bundled libraries/utilities in NT to make it easier.  However, there are a bunch of NT implementations of rsh out there.  For example, all the commercial X-Windows servers seem to come bundled with one.

Finally, if security really is an issue, you probably want to run Secure SHell (SSH) on both the Unix server and the NT client.  See for info on this option.
templer122197Author Commented:
Dear Chris,

Sorry for the very late reply. Thanks for your answers. Thanks a lot. Would appreciate if you could direct me to a free component that does all the 'telnet' job. Thanks again :)

My email is


The telnet is extremely simplistic.  Open the port, send the user name, send the password, then send the command.

If you're doing this in a language that directly supports socket calls (C, C++, perl), it should be easy enough.

Otherwise, you can ride on top of the above-mentioned netcat.

Strange things may happen if the password's bad, the system prompts you to changed an old password, or some such.  But that's the price you pay for riding on a protocol meant for human interaction instead of one designed for scripting (rsh/ssh).  You can fix this in the Unix world with "expect," but I don't think it runs on NT.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.