For setting up a echo service in Debian, you can install xinetd with:
apt-get install xinetd
Than you have to change the disable directive to no in /etc/xinetd.d/echo; or if the file does not exist, create it as shown here:
# default: off
# description: An xinetd internal service which echo's characters back to
# clients.
# This is the tcp version.
service echo
{
disable = no
type = INTERNAL
id = echo-stream
socket_type = stream
protocol = tcp
user = root
wait = no
}
# This is the udp version.
service echo
{
disable = yes
type = INTERNAL
id = echo-dgram
socket_type = dgram
protocol = udp
user = root
wait = yes
}
After setting disable = no, or creating the file, your restart xinetd with:
sudo service xinetd restart
To test the echo TCP service:
$nc localhost echo
testing...
testing...
xxxx
xxxx
^C