Operating System - HP-UX
1834253 Members
2185 Online
110066 Solutions
New Discussion

Re: How do I pass information while telnetting to another server?

 
keith runnels_1
Occasional Advisor

How do I pass information while telnetting to another server?

I'm connecting with an X-terminal to one unix server, then telnetting to another. I need to pass some information, such as IP for setting the DISPLAY, to that final server during the telnet process.

Is there some way of sending info automatically (ie. without user intervention) during the telnet connection/login process? I don't have rcp or ssh capability, so I can't transfer a file which contains the info.

Any help would be appreciated. Thanks!
3 REPLIES 3
c_51
Trusted Contributor

Re: How do I pass information while telnetting to another server?

using telnet) no there isn't any way

using rlogin) rlogin sends the value of TERM, you can encode the value of TERM to what you want, but that also means you have to decode the value during your logon on the destination server.

using remsh) you can execute something like an hpterm which has an option for setting the display variable.

use the who command to tell which system you came from. in which case you could do something like,

here=$(hostname)
there=$(who -mu)
if [[ $here = "systemA" && $there = "systemB" ]] ;then
display=Xterminal:0.0
fi
etc.
TwoProc
Honored Contributor

Re: How do I pass information while telnetting to another server?

I'd really recommend putting in ssh - this would provide real easy solution...

If you just run "ssh -X servername" you'll automatically get an X connection in a pipe connected to your current display - but to a pseudoterm.

A bit difficult to explain (easier to understand once you've seen it), but this is one of the great features of ssh - X Windows pass-though.
We are the people our parents warned us about --Jimmy Buffett
George Spencer_4
Frequent Advisor

Re: How do I pass information while telnetting to another server?

One way of achieving this would be to create an expect script to carry out the telnet connection, export the desired TERM variable, then pass the session on to the user.

If you always use a particular terminal type, why don't you hard code it in the .profile on the final host?