Operating System - HP-UX
1850960 Members
6431 Online
104056 Solutions
New Discussion

Re: Display full IP address for export when using terminal server

 

Display full IP address for export when using terminal server

Is there a way to display the full IP address of a user who has logged in via a terminal server to a HP 11.11 server.
The user needs to export their DISPLAY back to the IP address.
I thought the last command would show the complete address i.e. 199.99.99.99:1.0?However, using last -R (and fwtmp) only displays a truncated column with the hostname of the terminal server which is not specific enough to export the DISPLAY to.
I have tried variations on the who (-um) (-R) and who am i commands.
8 REPLIES 8
Pete Randall
Outstanding Contributor

Re: Display full IP address for export when using terminal server

David,

Would the technique described in this thread work?

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=758221


Pete

Pete
roger_122
Occasional Advisor

Re: Display full IP address for export when using terminal server

David

What does who -R give you?

Roger
Mauro Gatti
Valued Contributor

Re: Display full IP address for export when using terminal server

Why something like:
export DISPLAY=$(who -mu|awk '{print $8}'):0.0
doesn't suite fine for you?

RGDS
Ubi maior, minor cessat!

Re: Display full IP address for export when using terminal server

Hi,
Thanks for the replies but none of them solve the problem.
who -um shows the hostname only as does
who am i -R

I need the specific IP address per user login from the terminal server. There are five people login into the terminal server then onto the UNIX server. They all appear with the same hostname address.

They need to be able to differentiate one address from the other.
Pete Randall
Outstanding Contributor

Re: Display full IP address for export when using terminal server

David,

Check Clay's final response in the thread I direct you to. It's for C shell, but it works for me like this, too:

$ XX=`who -um | awk '{ split($NF,x,":"); print x[1] }'`
$ echo $XX
george
$ getip ${XX}
199.1.4.215

The key is the getip.


Pete

Pete
TwoProc
Honored Contributor

Re: Display full IP address for export when using terminal server

David, depending on how it is set up (and what brand/type it is)- it is possible to have each person coming into/from a termserver have the same IP address, and each hardware port having just each have a different IP port number. So, the different users all having the same IP is probably correct.
We are the people our parents warned us about --Jimmy Buffett
Mel Burslan
Honored Contributor

Re: Display full IP address for export when using terminal server

David,

If I am not misunderstanding your dilemma, you are using a terminal server (or something like it) as a concentration point and this point's name, hence the ip address, is showing up in the who -um. In which cas, you will not be able to obtain the actual communication initiating workstations ip address anywhere on your shell variables, hence will not be able to export it.

On the other hand, I know that there is a ssh tunneling for X-windows traffic, which does what you need to do, but details of the method eludes me. I have seen it happen. Someone at one of my old workplaces, ssh'ed into his home linux machine using putty or securecrt(details of which I do not remember) through 3 firewalls, from a corporate network. And, while his reflection-x emulation running on his desktop, he fired up an x-clock session and I have seen it show up on his corporate desktop. So, the functionality is there but how to do it is something I can not answer. I am sure someone else here can explain it to you.

Needless to say, your server should be running sshd and be able to accept ssh connections, as well as the clients should have some sort of ssh client installed.
________________________________
UNIX because I majored in cryptology...

Re: Display full IP address for export when using terminal server

Hi,

Found the users had changed their access method. They were using REXEC in place of TELNET. When TELNET is used the individual IP address shows from the last -R command not the terminal server host name.

Thanks for the replies, I have assigned some points.