- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: telnet/DISPLAY: HPUX vs Solaris
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2003 05:00 AM
06-23-2003 05:00 AM
I have a Linux workstation that I use to connect to both HPUX 11.11 and Solaris 8 servers. When I telnet to the Solaris servers, the DISPLAY environment variable is "automatically" set, pointing back to my workstation. When I telnet to the HPUX servers, the DISPLAY environment varialbe is not set.
Is there a way to configure telnetd on HPUX so that the DISPLAY environment variable gets set?
( Yes, I know I SHOULD be using ssh )
Thanks,
Tom
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2003 05:05 AM
06-23-2003 05:05 AM
Re: telnet/DISPLAY: HPUX vs Solaris
Edit you .profile
-----
# -- Do trick to set the display in case of remote login
PTS=`who am i |awk '{ print $2 }'`
#HOST=`who | grep ${PTS}' ' | cut -c38- | sed 's/(\(.*\)[:][0][.][0])/\1/'`
HOST=`who | grep ${PTS} | awk '{print $6}' | sed -e 's/[()]//g'`
if [ "$HOST" != "" ] && [ "$HOST" != ":0" ] && [ "$HOST" != ":0.0" ];
then
echo " +--<<"
echo " | Remote login detected, setting DISPLAY to $HOST:0.0"
echo " +-->>"
export DISPLAY=$HOST:0.0
fi
set -o vi
-------
Robert-Jan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2003 05:08 AM
06-23-2003 05:08 AM
Re: telnet/DISPLAY: HPUX vs Solaris
In ~/.login I think in csh.
export DISPLAY=X.X.X.X:0.0
setenv DISPLAY X.X.X.X:0.0
Zeev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2003 05:09 AM
06-23-2003 05:09 AM
Re: telnet/DISPLAY: HPUX vs Solaris
I found this rather old document: A4667710 (1997):
The following scripts allow the DISPLAY variable to be set
regardless of rlogin or telnet.
The first script can be melded into the .profile file.
---------------------------1st script---------------------------------
DISPLAY=`/bin/who -mR | sed 's/.*(\([a-z0-9]*\).*/\1/'`:0
export DISPLAY
----------------------------------------------------------------------
The second script is a separate script with comments telling
what to put in the .profile. Both scripts will work.
---------------------------2nd script---------------------------------
#!/bin/ksh
# Put the following at the top of your $HOME/.profile
#echo $TERM | grep -q =
#if [ $? = 0 ]
# then
# DISPLAY=${TERM#*=}
# export DISPLAY
# TERM=${TERM%=*}
# echo "DISPLAY=$DISPLAY"
# echo "TERM=$TERM"
#fi
#
#
# Invoke as follows:
# xlogin
#
export TERM=$TERM=$DISPLAY
rlogin $1
-----------------------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2003 06:34 AM
06-23-2003 06:34 AM
Re: telnet/DISPLAY: HPUX vs Solaris
Thanks for the replies!
It will take me a day or two to implement and test these options. I'll be back with points and what worked/didn't work after that.
Thanks again,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2003 12:12 PM
06-23-2003 12:12 PM
Re: telnet/DISPLAY: HPUX vs Solaris
Thanks, but the " PTS=`who am i |awk '{ print $2 }'` " command set PTS to the pseudo-terminal "pst/nn" on my server. And then the HOST variable ended up empty with:
HOST=`who | grep ${PTS} | awk '{print $6}' | sed -e 's/[()]//g'`
becasuse there was no $6 field from the who comamnd. I'm using HP-UX 11.11. Maybe 'who' is working different for me? Is the LOCALE different for a default install in the U.S. versus the Netherlands?
Zeev,
Thanks, but I was trying to avoid arbitrarily setting the DISPLAY variable. If I telneted into the target server from someplace other than my workstation, I wouldn't want the DISPLAY variable pointing to my workstation.
Elena,
Yours got me to the solution but there were some problems. The
DISPLAY=`/bin/who -mR | sed 's/.*(\([a-z0-9]*\).*/\1/'`:0
command set DISPLAY to "first octet:0". It truncated the 2nd, 3rd, and 4th octets of the IP address. But I just replaced it with this
DISPLAY=$(who -mR | cut -f2 -d"(" | cut -f1 -d")")
DISPLAY=${DISPLAY}:0.0
and I was cooking.
I always forget that there are other options to the simple commands like "who" that I use everyday.
Again, thanks to all.
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2003 12:19 PM
06-23-2003 12:19 PM
Re: telnet/DISPLAY: HPUX vs Solaris
You have the option to set the DISPLAY in
enviroment files but you also have options
in ssh & X that made automaticly x-forwarding
that if you made ssh connection and not set
dispaly it go automaticly to the machine that
you start the ssh conection from.
Check the docs of ssh for enable this.
Caesar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2003 12:42 PM
06-23-2003 12:42 PM
Re: telnet/DISPLAY: HPUX vs Solaris
Sorry, that it appeared not working. You may also want to simplify a little, like this:
hpd320te(root):/> DISPLAY=`who -mR |cut -f2 -d"("|cut -f1 -d")"`:0.0
hpd320te(root):/> echo $DISPLAY
10.5.13.23:0.0
Elena.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-23-2003 04:06 PM
06-23-2003 04:06 PM
Solutionexport DISPLAY=$(/usr/bin/who -muR | awk '{print $NF}'):0.0
This works well in case who changes the number of parameters ($NF is always the last one). Note that some admins will use the TERM variable to propagate the local machine's name. That's because the telnet protocol will carry TERM through to the server...which is OK unless the window you are starting is a text window like xterm, dtterm, hpterm, etc. The TERM value must match the actual model of terminal being used and a DISPLAY value won't work. That's why /etc/profile or .profile should always run ttytype during login (and ignore the current value of $TERM) as in:
eval $(ttytyps -s)
This will query the terminal directly rather than using $TERM as is.
Bill Hassell, sysadmin