`
maxer025
  • 浏览: 79840 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
文章分类
社区版块
存档分类
最新评论

XINETD TCP echo service

阅读更多
https://goyalankit.com/blog/xinetd


XINETD - Extended Internet Daemon
April 16, 2017

I was recently looking into ways to provide ssh access inside linux network namespaces and came across xinetd. So I decided to dig more into it. Noting it down here so that I can refer it back.

XINETD
It’s basically a daemon that listens for network requests and services them by spawning more processes.

The master configuration for xinetd lives in /etc/xinetd.conf. Each service managed by xinetd has a configuration file in /etc/xinetd.d/.

Each network service is listed in /etc/services that xinetd could potentially manage.

Let’s look at an example from one of the services in /etc/xinetd.d/ to see how it works:

An echo service
This was a default service that was present on my RHEL6 box. There were lots of settings in this file which were basically commented out. Most of them are self explanatory, so I have omitted them for brevity.

$ sudo cat /etc/xinetd.d/echo-stream
# This is the configuration for the tcp/stream echo service.

service echo
{
# This is for quick on or off of the service
disable = yes

# The next attributes are mandatory for all services
id = echo-stream
type = INTERNAL
wait = no
socket_type = stream
# protocol =  socket type is usually enough

}
echo service simply provides an echo service (duh). But what port does it listen to? The port can be checked in /etc/services file, search for echo in file, and on my machine it had an entry that looked like this:

$ sudo cat /etc/services | grep echo
echo            7/tcp
If you try to connect to this port; the connection will fail since the disabled flag is set to yes in the above configuration file.

$ telnet 172.22.210.126 7
Trying 172.22.210.126...
telnet: connect to address 172.22.210.126: Connection refused
telnet: Unable to connect to remote host
Let’s enable the service by setting disable = no in /etc/xinetd.d/echo-stream. In addition, you’d need to restart the xinetd service.

$ sudo service xinetd restart
Stopping xinetd:                                           [  OK  ]
Starting xinetd:                                           [  OK  ]
Now again, let’s try to connect to service.

$ telnet 172.22.210.126 7
Trying 172.22.210.126...
Connected to angoyal-ld2.linkedin.biz.
Escape character is '^]'.
hola  <---- I said hola to Server.
hola  ----> Server said hola back.
^]
telnet> q
Connection closed.
Sweet.

You can use xinetd to run your own network service and have full control. I have some ideas which I’ll document if they work.

So long.
分享到:
评论

相关推荐

    xinetd-master.zip

    Xinetd提供了一些工具和选项用于调试和维护,例如,可以使用`service xinetd status`检查服务状态,`service xinetd restart`重启服务,以及`tail -f /var/log/messages`实时查看日志,帮助诊断和解决问题。...

    使用xinetd搭建VNCServer

    ### 使用xinetd搭建VNCServer #### 一、引言 在远程访问技术中,VNC(Virtual Network Computing)是一种被广泛使用的图形桌面共享系统。通过VNC,用户可以在本地计算机上操作远程计算机的图形界面,这对于系统管理...

    简析Suse Linux的xinetd服务.pdf

    可以通过systemctl或service命令来启动、停止或查看xinetd的状态。例如,"systemctl start xinetd"用于启动服务,"systemctl status xinetd"查看服务状态。 总的来说,Suse Linux的xinetd服务是一个功能强大的网络...

    xinetd.zip

    xinetd-2.3.14-40.el6.x86_64,xinetd即extended internet daemon,xinetd是新一代的网络守护进程服务程序,又叫超级Internet服务器。...xinetd提供类似于inetd+tcp_wrapper的功能,但是更加强大和安全

    xinetd-2.3.15.tar.gz

     xinetd提供类似于inetd+tcp_wrapper的功能,但是更加强大和安全。它能提供以下特色:  * 支持对tcp、udp、RPC服务(但是当前对RPC的支持不够稳定)  * 基于时间段的访问控制  * 功能完备的log功能,即可以记录...

    用xinetd简化Linux与Windows的通讯.pdf

    【标题】: "用xinetd简化Linux与Windows的通讯" 【描述】: 本文讨论了如何使用xinetd服务来简化Linux系统与Windows之间的通信。通过xinetd,可以在Linux上实现自定义服务,同时客户端是用C++ Builder在Windows上...

    xinetd-2.3.14-40.el6.x86_64.rpm

    在命令行下执行 rpm -ivh xinetd*.rpm 进行安装,安装完后,编辑 /etc/xinetd.d/telnet,把disable 的yes 改为no 。执行命令 service xinetd start 即可启动服务,必要时关闭防火墙

    xinetd-2.3.14-34.el6.x86_64.rpm

    4. 启动或重启xinetd服务以应用更改:`sudo service xinetd start` 或 `sudo service xinetd restart`。 5. 如果打算安装telnet服务,可以使用`sudo yum install telnet-server`命令。 6. 最后,编辑`/etc/xinetd.d/...

    xinetd-2.3.14

    xinetd-2.3.14,包含2个适用不通版本号的包。linux的xinetd的安装,好像区分32位和64位,多给个选择,进行安装

    xinetd完整代码

    **xinetd(eXtended Internet Services Daemon)** 是Linux操作系统中的一种超级服务器,它负责管理和控制基于网络的服务。这个“xinetd完整代码”很可能是xinetd的源码包,版本为2.3.15。通过研究这个源码,我们...

    xinetd-2.3.14.tar.gz

    linux telnet服务守护进程,在命令行下执行 rpm -ivh xinetd*.rpm 进行安装,安装完后,编辑 /etc/xinetd.d/telnet,把disable 的yes 改为no 。执行命令 service xinetd start 即可启动服务,必要时关闭防火墙

    xinetd-2.3.15-13.el7.x86_64.rpm

    xinetd rpm文件,用来配合haproxy,通过xinetd提供的http服务mycatstatus来让Haproxy进行Mycat服务检测,即检测Mycat存活状态。Haproxy通过调用该http服务获取Mycat运行状态。

    telnet离线安装包rpm(含xinetd)

    telnet离线安装包rpm(含xinetd),适用于centOS6版本!

    xinetd-2.3.14-13.el5.x86_64.rpm

    xinetd-2.3.14-13.el5.x86_64xinetd-2.3.14-13.el5.x86_64xinetd-2.3.14-13.el5.x86_64xinetd-2.3.14-13.el5.x86_64xinetd-2.3.14-13.el5.x86_64xinetd-2.3.14-13.el5.x86_64xinetd-2.3.14-13.el5.x86_64

    071403 xinetd超级守护进程1

    protocol = tcp wait = no user = root server = /usr/sbin/smbstatus disable = no } ``` 在这个例子中,`only_from`定义了允许访问的来源,`port`指定了服务监听的端口,`server`是服务启动程序,`disable`...

    在xinetd环境下如何获取客户端IP地址

    ### 在xinetd环境下如何获取客户端IP地址 在Linux系统中,`xinetd`(Internet Services Daemon)作为超级服务守护进程,负责监听各种网络请求并启动相应的服务处理这些请求。由于`xinetd`环境下的服务器程序通常...

    xinetd-2.3.14-10.el5.i386.rpm

    xinetd安装程序,xinetd 取代了inetd,并且提供了访问控制、加强的日志和资源管理功能

    xinetd-2.3.15-14.el7.x86_64.rpm

    xinetd-2.3.15-14.el7.x86_64.rpm

    xinetd-2.3.14-18.fc9.i386

    xinetd是一个daemon程序,所有结尾带d的程序都是daemon程序,也就是守护程序 守护程序分为2种处理模式: 第一个是stand alone状态的,表示该程序始终监听,一直处于运行状态,例如httpd 第二个是super daemon,它...

Global site tag (gtag.js) - Google Analytics