![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Six Twitter clients for the Linux desktop and one for the road | iBot | UNIX and Linux RSS News | 0 | 04-29-2008 01:30 PM |
| login in red hat linux | asutoshch | Linux | 3 | 04-02-2008 11:45 PM |
| Linux clients for three top P2P networks | iBot | UNIX and Linux RSS News | 0 | 03-20-2008 01:40 AM |
| how to find out unix server details | thopputhurai | Filesystems, Disks and Memory | 4 | 04-23-2007 03:16 AM |
| Map Drive from UNIX Server to Windows Clients | kafaween | UNIX for Dummies Questions & Answers | 3 | 09-12-2006 07:37 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
Hi there,
I am wondering if by logging in to a unix system, if it is possible to get the IP address of the machine I am connecting FROM. I know how I can do this using the name server, but is this possible without a host lookup? Thanks, -ghoti |
| Forum Sponsor | ||
|
|
|
#2
|
|||
|
|||
|
If you were connected via ssh/telnet running "netstat -n -e" from the server would show what user ids and ip addresses are connected to the server.
"netstat -e" would show user names and hostnames connecting to the server. The ipaddress and user details will also go into one of the system's log files although I you might not have access. It may sound silly but why do you need to know this? Andy Hibbins |
|
#3
|
||||
|
||||
|
Thanks for the help Andy, but I had got that far already.
The problem is this: we are working using a unix box, accessed from several windows systems, usually running Hummingbird Exceed. As some of the technicians need to access the server from many locations worldwide, I need to set the $DISPLAY variable using an IP address rather than a hostname, as not all the IP's are in the DNS. I had initially thought that I could use 'netstat |grep X' to isolate the connections using an Xserver, then do the same using netstat -n to get the ip number, but this fails with multiple connections, as it is very difficult to differentiate using a script. Cheers for the help tho... -ghoti |
|
#4
|
||||
|
||||
|
On my systems, <B>netstat -en </B> provides the kernel level user of the sockets (tcp, unix) , not the application level user (i.e john, harry, sally, root).
Working to automatically set the X display parameter is normally not performed with shell utilities such as netstat; but passed as environmental varialble during remote login. This is a function of the remote login protocol. Some versions of telnet automatically set the DISPLAY variable, so that when you login remotely, DISPLAY is set and exported for X to use. However, your problem seems to be that this works for you already, but you have DNS issues. I think it is possible to have the remote login session pass the IP| address in the DISPLAY environment variable. There is no reason to only pass the FQDN to $DISPLAY. As a matter of fact, if you have your remote users set the IP address in their HOSTNAME environment variable before remote login (or do this is the login script); then you will not have to worry about the DNS issues. HOSTNAME = 111.222.333.444 DISPLAY = $HOSTNAME:0.0 |
|
#5
|
||||
|
||||
|
Thsi is a good option, but it requires special settings on all the clients, rather than just one script..
Thanks anyway, and I'll keep looking, if I find it, I'll post my solution, -ghoti |
|
#6
|
|||
|
|||
|
have you tried #who -a ???
|
|
#7
|
||||
|
||||
|
Thanks for the suggestion, but this seems to use the host lookup again, I am really looking for just the IP information.
Cheers anyway! |
||||
| Google The UNIX and Linux Forums |
| Tags |
| export display, linux |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|