Operating System - Linux
1829448 Members
1069 Online
109992 Solutions
New Discussion

Re: passing a login string to a telnet session

 
SOLVED
Go to solution
Ross Hansen
Occasional Advisor

passing a login string to a telnet session

I need to generate a telnet session to a HP 3000 box and give the logon as a specific string to initiate an event.
Once I telnet into the 3000 box I can't get the linux box to give the login string.
It doesn't appear as though the 3000 box is able to except the -l option of the telnet command to specify user.

Is there another way to do this or can I script my way around this?
7 REPLIES 7
Steven E. Protter
Exalted Contributor

Re: passing a login string to a telnet session

Buy default Linux does not enable the telnetd daemon on install.

Here is how to turn it on.

In the directory /etc/xinetd.d/telnet file

change disable=yes to disable=no

save the file

service xinetd restart

Now telnet login will be allowed.

You are better off from a security standpoint to use ssh(Secure Shell on HP-UX) to connect to openssh on Linux.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Olivier Drouin
Trusted Contributor

Re: passing a login string to a telnet session

Do you want to automate some remote command through telnet ?

SSH has this capability built-in ( with public/private keys ).


Normally when I have telnet admin ports for some programs ( no passwd required if connection is from localhost ) I do like this

(sleep 1; echo "command 1"; sleep 2; echo "command 2; sleep 1; "echo exit" ) | telnet localhost someport

... you can try to 'echo' the login/passwd, I never did.


Martin P.J. Zinser
Honored Contributor

Re: passing a login string to a telnet session

Hello,

you might want to try -a (automatic login) together with -l . If this works or not really depends on the telnet deamon on the HP 3000.
You do not need the telnet daemon for this to be active on the linux box as you are only using the telnet client, not the server.

Greetings, Martin
Alexander Chuzhoy
Honored Contributor
Solution

Re: passing a login string to a telnet session

You can use the "expect" utility capabilities to simply script your way to login to remote station via telnet.


read it's man for more details...
Massimo Bianchi
Honored Contributor

Re: passing a login string to a telnet session

If ssh or rcommands are not a way, then the only working solution is expect.

massimo
Olivier Drouin
Trusted Contributor

Re: passing a login string to a telnet session

Oh, I forgot about expect. I used it for dialup login sequences. way to go.
Ross Hansen
Occasional Advisor

Re: passing a login string to a telnet session

Linux box runninh ssh and 3000 box running mpe. I will be using except util.

Thanks everyone