1834518 Members
2416 Online
110068 Solutions
New Discussion

Telnet to port

 
Paula J Frazer-Campbell
Honored Contributor

Telnet to port

Hi to all

I am trying to set up a telnet session to a port.

i.e. telnet 191.1.1.111 5729.

N class running 11.00

Basically I am trying to push some users straight to an application with no Unix login.

I have defined the port in services: -

vdx 5721/tcp # Test for vdx

I have set it in inetd.conf:-
vdx stream tcp nowait vdx /bin/ksh ksh -c /avro/DATA/VDX

inetd -c has been run.

The VDX file contains:-
---------------------------------------------------
LOGNAME=vdx; export LOGNAME
/usr/bin/strchg -h ptem,idterm >/dev/nell 2>$1
stty tabs ff0 cr0 nl0 echoe ofill
stty erase kill intr quit
stty tabs ff0 cr0 nl0 echoe ofill
tabs -1
TERM=prestel.40; export TERM
# Executable search path
PATH=.:/usr/bin:/usr/sbin:/usr/ucb:`cat /.uvhome`/bin:/etc;export PATH
cd /avro/DATA
#Start app
uv
------------------------------------------------

When I connect I see the server push the screen build to my terminal session and as soon as the prompt stops at the application login and is requesting communication from the terminal session is stops and loops its screen build again.

I know this type of connection is missing telnetd and so I need to push modules (strchg) to get a conversation, but at present I am stuck.

I will send the person who solves this a present from my trip to Dubai.

How is that for incentive.

Paula

If you can spell SysAdmin then you is one - anon
24 REPLIES 24
Jeff Schussele
Honored Contributor

Re: Telnet to port

Hi Paula,

First off I assume that "/dev/nell" is a typo in your question.
Second I would ask if your sure of your module order. I believe the last pushed should be the closest to the driver. Try reversing the order.
Finally, is this app a char driven (non-GUI) app? If GUI how do you set display?

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Rita C Workman
Honored Contributor

Re: Telnet to port

Well Princess, I am sure greater minds will suggest other things....so I shall begin with the simple things..

is it >/dev/nell 2>$1
or is it > /dev/null 2>$1

Rita
Bill Hassell
Honored Contributor

Re: Telnet to port

HJere's another thought: the user's shell does not have to be a shell program at all, it can be a startup script (with trap so the user can't escape) that sets the environment (including SHELL=/dev/null) and runs the process. When the process ends, the user is disconnected.


Bill Hassell, sysadmin
Paula J Frazer-Campbell
Honored Contributor

Re: Telnet to port

Hi

Yes nell is a typo

It is a char session.


Paula
If you can spell SysAdmin then you is one - anon
Paula J Frazer-Campbell
Honored Contributor

Re: Telnet to port

Further info

As it loops again to reset I get:-

Stty : unknown error

Also as it looks quickly I cannot pick up a pid and attach to it to interogate it more.

Paula
If you can spell SysAdmin then you is one - anon
Jeff Schussele
Honored Contributor

Re: Telnet to port

Paula,

Believe your stty error comes from the following line
stty erase kill intr quit
You need to define the ctrl chars for those functions on that line - EX
stty kill '^X' intr '^C'

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Mark Greene_1
Honored Contributor

Re: Telnet to port

have you tried replacing the uv with the full pathname? IIRC, isn't it /usr/uv/bin/uv

also, IIRC, the uv process just swaps the shell for the universe shell process, uvsh (or something similar). have you tried calleding tech support and asking them if you can link to the universe shell directly instead of calling it via uv?

finally, are you subscribed to Cliff Oliver's universe e-mail list?

List-Subscribe:
List-Post:
List-Help:
List-Unsubscribe:

HTH
Mark
the future will be a lot like now, only later
Paula J Frazer-Campbell
Honored Contributor

Re: Telnet to port

Mark

Thanks for that but universe is firing up and via the univere login program I path a user with a username of vdx to the application.

I see this occur and the application login screen builds ok.

The problem is the communication between the terminal session and the server which I am having problems with.

Thanks for universe List info.

Paula
If you can spell SysAdmin then you is one - anon
Mark Greene_1
Honored Contributor

Re: Telnet to port

something else that occured to me: I think universe requires a tty. with your connection method, is the process assigned a tty that you can see in the ps listing? and can you then in the script do a who -um to get the tty and explicitly redirect that to the uv command?

mark
the future will be a lot like now, only later
Wodisch
Honored Contributor

Re: Telnet to port

Hi princess,

first the typos:

...,idterm >/dev/nell 2>$1
and

should really be:

...,ldterm >/dev/null 2>&1

Then I would set HOME in addition to LOGNAME, as many programs expect it to exist.

Then I do miss the stream module "compat".

The message from "stty" hints at your session not being a "process leader" bound to that terminal.

Just my usual $0.02,
Wodisch
Paula J Frazer-Campbell
Honored Contributor

Re: Telnet to port

Hi

Tried all suggestions including mine -- still cannot hold a conversation.

A perl module called "try" has been suggested ?

Paula

If you can spell SysAdmin then you is one - anon
Steven Sim Kok Leong
Honored Contributor

Re: Telnet to port

Hi,

Just a hunch, have you tried using Expect? There are some good client-server example scripts (comes with the Expect source distribution) that you might be able to reuse for your cause.

Here's a list of the available example scripts:

http://expect.nist.gov/example/README

Hope this helps. Regards.

Steven Sim Kok Leong
Volker Borowski
Honored Contributor

Re: Telnet to port

Hi Paula,

1)

try "vi /tmp/testfile"
as the finally called application.

2)

add

echo script called `date` >> /tmp/logfile

as the first line and

>> /tmp/logfile

after each command in the script to catch messages. Redirect stderr in addition.

May be you get more information

Hope this helps
Volker
John Palmer
Honored Contributor

Re: Telnet to port

Hi Paula,

Is a login out of the question? Even one that requires no password?

At least a normal telnetd will work, set the user's .profile to:

export LOGNAME=vdx
export TERM=prestel.40
export PATH=.:/usr/bin:/usr/sbin:/usr/ucb:`cat /.uvhome`/bin:/etccd /avro/DATA
exec uv

and Bob should be your proverbial uncle!

Regards,
John
Paula J Frazer-Campbell
Honored Contributor

Re: Telnet to port

Hi John

This is going to be an via the internet presentation of our booking system to travel agents.

I intend not to give them a unix shell so that if the application fails than I have a safety net.

If I use telnetd then a shell is required, by pushing them via inetd.conf direct to the application then the application has got them.

I have run this application for four years with over 14000 connections per day to it with no dropouts.

It is at present connected via x25 and with that all the costs of x25 connectivity to the big wide world, with ip via the internet my costs are greatly reduced.

So my incentive to get this working will save lots of ??????????s

Paula
If you can spell SysAdmin then you is one - anon
Volker Borowski
Honored Contributor

Re: Telnet to port

Hm,

I tried this

/usr/bin/strchg -h ptem,ldterm
stty echoe ofill
export LINES=24
export COLUMNS=80
export TERM=vt220
clear
vi /tmp/testfile
exit

works quite OK in a Reflection 2 window, with one exception:
At first, it only fills out half a screen. No idea why.
If you enter some text and scroll around in vi, everything seems to be ok. I can page back and forward, screencontrol seems to be fine with this stream.

So may be, the application requires a device, as someone already said ?!??

Is "uv" a binary executable or a script, that sets some stuff in addition ?

Volker
Mark Greene_1
Honored Contributor

Re: Telnet to port

>>This is going to be an via the internet presentation of our booking system to travel agents<<

What version of UV is this? As of 9.4 (IIRC), UV was both ODBC and JDBC compliant, so maybe you can collaborate with the application vendor for a quick-n-dirty scaled down version to do basic reporting and record querying.

Another thought may be if you can start a UV session for the app in the background and then use a middleware type of process to either ODBC or JDBC the input and output.

mark
the future will be a lot like now, only later
Paula J Frazer-Campbell
Honored Contributor

Re: Telnet to port

Mark

I am testing on Universe 9.6 and 9.4.1.1.I,

The application is our own which was written for a videotex / teletext screen.

I have an in house development team as our Flight only booking system is unique.

The front end has been in use for many years and the travel agents know and I hope love it so I am loath to change it, mind you I do not think the busdiness would let me.



Paula
If you can spell SysAdmin then you is one - anon
John Palmer
Honored Contributor

Re: Telnet to port

Hi again,

<< I intend not to give them a unix shell so that if the application fails than I have a safety net. >>

The 'exec uv' command in my earlier reply replaces the initial shell with the uv process. This means that there's no shell to revert to if your app fails. As soon as the app exits the user will lose their connection. The app has 'got them' and there's nowhere else to go.

Regards,
John
Vincent Fleming
Honored Contributor

Re: Telnet to port

You can set up the password file to launch your app also... which would probably work better since telnetd would be active, pty's will be setup, your app will be process leader on that tty, etc.

Do this by setting the 'shell' field in the /etc/passwd file to your app, like this:

appuser::1001:1001:app user:/tmp:/path/to/my/app

It'll launch the app instead of a shell that way.

Oh, you'll probably have to add your app to /etc/shells, too.

Good luck!
No matter where you go, there you are.
Paula J Frazer-Campbell
Honored Contributor

Re: Telnet to port

Hi to all

Thanks for your help.

Problem was that pushing the connection directy into Universe (database engine) that session went into uvsh - universe's own shell and allocated a Universe port number in the negative range i.e. -25673.

This negative number provided a problem as the software was written serverl years ago for dumb terminals and did not like this negative value.

So I put a routine in that looks for a connection of this type and and if the port number is negative it gets multiplied by -1.

---------------------------------------
0021: IF @LOGNAME EQ "vdxport" THEN
----:
0022: IF PORT.NO LT 1 THEN
----:
0023: PORT.NO = (PORT.NO * -1)
----:
0024: END
----:
0025: END
----------------------------------------


Once again thanks for all you help.


Paula
If you can spell SysAdmin then you is one - anon
Pete Randall
Outstanding Contributor

Re: Telnet to port

Paula,

So, I assume you're going to send yourself a nice present from your trip to Dubai?

Well done and have a great holiday.

Pete

Pete
Paula J Frazer-Campbell
Honored Contributor

Re: Telnet to port

Hi Pete

My present to myself is a week away in the sunshine with no unix servers to bother me.

Paula
If you can spell SysAdmin then you is one - anon
Pete Randall
Outstanding Contributor

Re: Telnet to port

Enjoy it - you've earned it.

Pete