The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


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 !!

More UNIX and Linux Forum Topics You Might Find Helpful
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

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-04-2001
ghoti's Avatar
Registered User
 

Join Date: Jul 2001
Location: Wales
Posts: 55
Unhappy IP details for Unix/Linux login clients?

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  
Old 07-04-2001
Registered User
 

Join Date: Jun 2001
Location: Leicestershire, UK
Posts: 92
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  
Old 07-04-2001
ghoti's Avatar
Registered User
 

Join Date: Jul 2001
Location: Wales
Posts: 55
Unhappy

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  
Old 07-04-2001
Neo's Avatar
Neo Neo is offline
Administrator
 

Join Date: Sep 2000
Location: Asia Pacific
Posts: 4,493
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  
Old 07-05-2001
ghoti's Avatar
Registered User
 

Join Date: Jul 2001
Location: Wales
Posts: 55
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  
Old 07-05-2001
Registered User
 

Join Date: Jun 2001
Location: DC
Posts: 5
have you tried #who -a ???
  #7  
Old 07-05-2001
ghoti's Avatar
Registered User
 

Join Date: Jul 2001
Location: Wales
Posts: 55
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
Closed Thread

Tags
export display, linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 12:39 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0