Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 Linux 平台上遇到了几个通过 telnet 管理的专有应用程序。远程 telnet 未启用,但在您执行 telnet 会话的主机上。您将获得一个界面,您可以在其中输入命令以使应用程序工作。我想知道如何为任何特定应用程序构建 telnet 接口。不是在寻找一步一步的,只是关于如何为应用程序构建 telnet 接口的基本/一般/全局答案。
telnet 基于 TCP/IP 协议。要从 C 程序“执行”远程登录,您将开始弄乱套接字、accept()-ing 连接并使用 -d 线程读取和写入它们fork()(这很简单)。
accept()
fork()
如果应用程序已经存在,并且已经通过 stdin/stdout 与控制台通信,您可以使用 (a) Internet 守护程序中的某些配置 (x)inetd或滥用瑞士军刀TCP/IP, netcat.
inetd
netcat
这两个程序的文档都模糊地描述了如何设置。如果您需要更多帮助,您知道该去哪里咨询!