back to index
daemontools install instructions
ucspi-tcp install instructions
getting started with tcpserver
setup of a daytime server
common tcpserver setups

Getting started with tcpserver

Some people think that using tcpserver is complicated. It really isn't. In the following example you'll run a fake telnetd that simply prints a string to the network and then closes the connection.

Fake telnetd

In a shell window, run this command line:

tcpserver -v -RHl0 2023 sh -c "echo 'Go away!'"

In another shell window, connect to the fake telnetd:

telnet 2023

Explanation of tcpserver command line options


tcpserver writes status messages to stdout. In a real world setup multilog will pick up the logging information.


This prevents various DNS lookups. See the man page for details. 2023

Listen on, port 2023.

sh -c "echo 'Go away!'"

This is the program that tcpserver runs upon each connection.

Real world example

A complete setup of a daytime server.


Stefan Krah <website @>