Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Create a Telnet Interface for an Application

Tags:

linux

telnet

I have come across a couple of proprietary applications on Linux platform which are administered via telnet. Remote telnet is not enabled but on the host you do a telnet session. You get an interface where you enter commands to make the application work. I was wondering how a telnet interface is built for any particular application. Not looking for a step-by-step, just a basic/general/big-picture answer of how one can approach building a telnet interface for an application.

like image 224
Code Ghar Avatar asked Nov 22 '25 14:11

Code Ghar


1 Answers

telnet is based on the TCP/IP protocol. To "do" telnet from a C program, you'd start messing with sockets, accept()-ing connections and reading and writing to them using fork()-d threads (that's VERY briefly it).

If the app is already there, and already communicates to the console via stdin/stdout, you can rig a telnet interface on to it using (a) some configuration in your Internet daemon, (x)inetd, or by misusing the Swiss Army knife of TCP/IP, netcat.

The docs for both those programs describe how to set things up, vaguely. If you need more help, you know where to ask!

like image 117
Carl Smotricz Avatar answered Nov 24 '25 03:11

Carl Smotricz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!