Help with tcpservers

From: Seel, John <John.Seel_at_US.Faulding.com>
Date: Mon, 18 Dec 2000 15:18:16 -0500

Hello Managers,

This is actually a followup to my posting with subject "Determining the IP
alias that a user connects to"

A fellow administrator was kind enough to point me in the direction of
ucspi-tcp "tcpserver" by D. J. Bernstein (http://cr.yp.to/), however, the
documentation is limited and I am still having trouble getting it to work as
I would like.

I was hoping someone out there may have some experience or be able to point
to me more detailed documentation.

tcpserver looks like a slick program. I had no problem compiling it and
installing it.
I have configured it to replace telnetd by commenting out telnetd in
/etc/inetd.conf. For testing purposes I start tcpserver manually, but will
probably start and/or stop it through /sbin/init.d, inet.local, or the
cluster service start/stop scripts as I need for each alias.

However, for testing I start it with this line( or slight variations):
/usr/local/bin/tcpserver -v -x /etc/rules.cdb -B "Hello World!" 192.168.1.1
23 /usr/sbin/telnetd


Depending upon the rules I've set up, this works. I can telnet to that
address, get the banner, and login.

I start an alias with:
ifconfig tu0 alias 192.168.1.100

Then start another tcpserver on that alias:
/usr/local/bin/tcpserver -v -x /etc/rules.cdb -B "Hello New World!"
192.168.1.100 23 /usr/sbin/telnetd

I can then telnet to that address, get the new banner, and login. I can also
still connect to the original address with no problem.

However, my problem seems to lie with the rules. tcprules is used to create
the cdb file for the tcpserver rules. The documentation is not clear on how
to exit tcprules after entering each rule as a line. Control D seems to
terminate the program but when I check the rules with tcprulescheck, it
never seems to have accepted the proper rules or only keeps the last rule
entered.

Does anyone know the exact method of using tcprules?

Even when it seems that I have properly entered a single rule to allow all
and set a variable as follows:

# /usr/local/bin/tcprules /etc/rules.cdb /etc/rules.tmp
:allow,SERVICE="test"
# /usr/local/bin/tcprulescheck /etc/rules.cdb
rule :
set environment variable SERVICE=test
allow connection
#


When I log in, the variable SERVICE is never passed through telnetd to my
shell as I would like.
Is this related to passing the variable to telnetd? Will it drop the
variables assigned before telnetd is invoked?

Or am going about this all wrong?

Any help or suggestions would of course be greatly appreciated.

Thanks.

John




----------------------------------------------------
John Seel
UNIX Systems Administrator
Faulding, Inc.
'john.seel_at_us.faulding.com"
(908) 659-2398
-----------------------------------------------------
Received on Mon Dec 18 2000 - 20:19:57 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:41 NZDT