Skip to Main Content
Linux Security Cookbook
book

Linux Security Cookbook

by Daniel J. Barrett, Richard E. Silverman, Robert G. Byrnes
June 2003
Intermediate to advanced content levelIntermediate to advanced
336 pages
8h 54m
English
O'Reilly Media, Inc.
Content preview from Linux Security Cookbook

3.6. Adding a New Service (inetd)

Problem

You want to add a new network service, controlled by inetd .

Solution

Add a new line to /etc/inetd.conf of the form:

               SERVICE_NAME  SOCKET_TYPE  PROTOCOL  THREADING  USER  /PATH/TO/SERVER  ARGS

Then signal inetd to reread /etc/inetd.conf. [Recipe 3.4]

Discussion

The values on the line are:

  1. Service name. A service listed in /etc/services . If it’s not, add an entry by selecting a service name, port number, and protocol. See services(5).

  2. Socket type . Either stream, dgram, raw, rdm, or seqpacket.

  3. Protocol. Typically tcp or udp.

  4. Threading . Use wait for single-threaded, or nowait for multithreaded.

  5. User . The service will run as this user.

  6. Path to server executable.

  7. Server arguments , separated by whitespace. You must begin with the zeroth argument, the server’s basename itself. For example, for /usr/sbin/in.telnetd, the zeroth argument would be in.telnetd.

A full example is:

telnet  stream  tcp  nowait  root  /usr/sbin/in.telnetd  in.telnetd

A line in inetd.conf may contain a few other details as well, specifying buffer sizes, a local host address for listening, and so forth. See the manpage.

See Also

inetd(8), inetd.conf(5), services(5).

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Linux Administration Cookbook

Linux Administration Cookbook

Adam K. Dean

Publisher Resources

ISBN: 0596003919Errata Page