*BSD News Article 15814


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!cs.utexas.edu!geraldo.cc.utexas.edu!mccoy
From: mccoy@ccwf.cc.utexas.edu (Jim McCoy)
Newsgroups: comp.os.386bsd.questions
Subject: Re: Installing a telnet port
Date: 9 May 1993 04:28:54 -0500
Organization: The University of Texas - Austin
Lines: 102
Sender: mccoy@tigger.cc.utexas.edu
Distribution: world
Message-ID: <1siism$q9g@tigger.cc.utexas.edu>
References: <1993May5.104913.20914@cnplss5.cnps.philips.nl> <1set0n$9ep@tierra.santafe.ede>
Reply-To: mccoy@ccwf.cc.utexas.edu
NNTP-Posting-Host: tigger.cc.utexas.edu


In article <1set0n$9ep@tierra.santafe.ede>, cag@SantaFe.edu (Chris
Goellner) writes: 
> Guido van Rooij (rooij@mozart.cft.philips.nl) wrote:
> : Try telnet <host> <portnr>. Next time read the man first
> 
> Next time read my post.  The question was !NOT! how to use telnet.  The
> question was how to configure my system to support different telnet ports.

Your question was somewhat ambiguous.  You asked about installing a telnet
port and then mentioned conntection in requiring a certain port.  The basic
problem is that you do not install a "telnet port".  If the "port" you are
connecting to is a telnet "port" you will be asked to login.  On the other
hand, one could interpret your request to mean a "telnet port" as in a
alternate version of telnet that in some way supported something your
doesn't or is somehow a non-unix or non-bsd piece of software or mod that
needs to be put into the telnet code. Telnet can also be used to connect to
a specific port.  I presume the first respondant thought you we speaking of
the latter. 

Your next line seems to indicate that this is not quite the case.

> The solution involves modifying inetd.conf and services not reading
> the manual.

In this case you are probably talking about changing the software so that
the "...game that has to be connected to over a telnet port..." will be
invoked for each instance of a connection to the particular port.  Like a
MUD or similar beast...

Did you try "man 5 inetd.conf" or "man 5 services"?

The short version is as follows:

From inetd.conf(5) 
     The inetd.conf  file  contains  the  list  of  servers  that
     inetd(8C)  invokes when it receives an Internet request over
     a socket.  Each server entry is composed of a single line of
     the form:

          service-name   socket-type   protocol   wait-
          status   uid   server-program   server-arguments

So you add a line to your inetd.conf like this:

mygame stream tcp nowait gameuser /path/and/invocation/string program-name

"mygame" is the service name this is defined in the /etc/services file by
you and can be any name you want. "stream" is the socket type, the other
common option is "dgram" (for datagram) and occasionally you will see "raw"
used.  If you use telnet to connect to the game then it is a stream
connection.  "tcp" is the protocol and is what a stream connection will
use, "udp" will be used for a dgram socket; rpc calls use "rcp/<proto>"
where proto is the udp or tcp protocols. "nowait" is the wait status and
will be nowait for all but single threaded datagram services; if you are
not sure what that is you are most likely not using them so make this field
"nowait".  "gameuser" the the username under which the program will be
invoked; select a non-root user for something as potentially unstable as
this might be. "/path..." is the pathname of the server to be invoked.
"program-name" is the name of the program and any flags you wanted to add
to it, basically this is how the program is invoked by inetd.

To define the service used in the service-name part of the inetd.conf and
to let the network stuff know where to direct the connection.  An example
of a possibel service entry for the above line is:

mygame	protocol/port aliases

"mygame" is the name os the service and is what is used to begin the line in
inetd.conf.  "protocol" is the type of the connection to the service and for
soemthing you telnet to it is fairly certain that protocol will be "tcp".
The "port" is where you tell the system what port the server will be
listening on.  Once defined, all connections to that port will invoke the
entry from inetd.conf for that particular service in the manner specified
in the inetd.conf entry.  "aliases" are any other names with which the
services might be requests.

Once you have added the entries in /etc/services and /etc/inetd.conf you
should restart or kill -HUP the inetd process so that the new inetd.conf
file is read in.  One this is done you should have the services I think you
are asking for...

In article <1s6i3p$d6a@tierra.santafe.ede> you write:
>[...] anyone will do since I compile it into the game. 

Once again there is some ambiguity here.  Now having seen your second
message it is possible to deduce that the "anyone" in your message refers
to telnet port numbers and not particular variant of the telnet code (as
the first respondant thought or as your mesage hinted at...)  If you mean
you can compile any port number into your game I suggest you choose some
nice, high port number not already in your services file.  Make the
services file change and compile this number into the server.  Once you
have the code ready and tested (you can test it by just invoking it from
the command line and then using telnet to connect to the port number you
compiled in) add the appropriate entry to inetd.conf.  

jim

-- 
Jim McCoy                	|  UT Unix Sysadmin Tiger Team
mccoy@ccwf.cc.utexas.edu 	|  #include <disclaimer.h>
pgp key available via "finger -l", on pubkey servers, or upon request