Question

bind xinetd to external port

I’ve setup a hello world service:

#!/bin/bash
echo "hello"

with xinetd:

service hello
{
	disable		= no
	socket_type	= stream
	protocol	= tcp
	port 		= 8000
	wait		= no
	user		= root
	server		= /home/github/hello
}

and opened port 8000 with ufw:

$ sudo ufw status
Status: active

To                         Action      From
--                         ------      ----
22                         ALLOW       Anywhere
8000                       ALLOW       Anywhere
8000 on eth0               ALLOW       Anywhere
22                         ALLOW       Anywhere (v6)
8000                       ALLOW       Anywhere (v6)
8000 on eth0               ALLOW       Anywhere (v6)

This works locally:

$ nc 127.0.0.1 8000
hello

but not from a remote machine:

 nc [filtered ip address] 8000
<hangs>

Any idea what I’m doing wrong?

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Hi @andrewddixon

Try checking the listening services:

sudo lsof -iTCP -sTCP:LISTEN -P

Otherwise, try stopping xinetd and starting it in debug mode:

sudo service xinetd stop

sudo xinetd -d