ip address of a client


 
Thread Tools Search this Thread
Special Forums IP Networking ip address of a client
# 1  
Old 11-20-2007
ip address of a client

A client(PC) connects to an unix server via terminal emulator.
How can I obtain that client's IP address?

The unix server is an old SVR4.2 (NCR) and the "who" command
does not show ip addresses.

I need a command or a shell script or a C/C++ program that will
help me to obtain the client's IP address.

Could anyone help me?
# 2  
Old 11-20-2007
Depends heavily on the terminal emulator. If it's one in the truest sense of the name, they'll be connecting as though on a directly connected terminal - so no IP. In that case, you'd need to look on the emulator to find the IP.

If you mean a terminal emulator like a piece of software on their client machine and they come in over IP and talk to something that doesn't use login. Find the relevant process and see what IP's it's got open connections to.

Or have I misunderstood the question? Smilie
# 3  
Old 11-21-2007
If I haven't misunderstood it too, the client's IP will appear somewhere in the logs.
# 4  
Old 11-21-2007
Thanks for your answer.

The client connects to the server with telnet. i.e. on the terminal emulator
window of the client the user sees "login:" and then logs on to the unix server.

Below is what "ps" command displays - note that there is no ip, but just the termid - pts/29:
ka2d2 28144 28142 0 Nov 20 pts/29 0:00 -sh

I want to find out the ip of the client from which the user "ka2d2" logged in the server.
# 5  
Old 11-21-2007
Ah, telnet clarifies things a fair bit.
If you can find a version of lsof for it you can use this to find the IP. Otherwise, I like sysgate's point that the IP will be in the logs at time of connection. So you can run the output of who through a grep of the logs (for the username and a login message), then tail off the last entry to get the IP.
# 6  
Old 11-23-2007
wtmp or utmp commands

"last" command may be helpful to you
# 7  
Old 11-26-2007
Sumitpandya and all others, thank you for your answers.

I found the solution with the "last" command.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Web Development

How to enable x-client-ip address in apache webserver LogFormat?

how to enable x-client-ip address in apache webserver LogFormat i tried below option, but no luck... 1. LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined 2. LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" proxy 3.... (0 Replies)
Discussion started by: raghur77
0 Replies

2. UNIX for Advanced & Expert Users

C program to detect duplicate ip address if any after assigning ip address to ethernet interface

Hi , Could someone let me know how to detect duplicate ip address after assigning ip address to ethernet interface using c program (3 Replies)
Discussion started by: Gopi Krishna P
3 Replies

3. Solaris

CJS installation problem(client display:requesting internet address for 0:21:28:17:80:f4)

hi can anyone fine a solution thwe the problem that am facing i was trying to install sun4v client vth sol10_U8, but when i played "boot net" its asking for "requesting internet address for 0:21:28:17:80:f4 plz give me a sol for this (1 Reply)
Discussion started by: all_is_well
1 Replies

4. UNIX for Advanced & Expert Users

Determining IP address of NFS server on client

Hi. We use an Isilon cluster system to provide our NAS. The Isilon uses a round-robin DNS setup to spread mount requests across the many nodes of the cluster. When a node needs work, the filesystems that are mounted to it need to be moved to other nodes prior to shutting the node down. I... (2 Replies)
Discussion started by: rascalrick
2 Replies

5. Solaris

How to get the IP address / Host name of client machine

Hi How to get the IP address / Host name of a particular user connected to Unix Server. For example: If used 'DevUser1' is connected to Unix server. I need to find out from which PC this connection has been made. How can this be achieved? Thanks (6 Replies)
Discussion started by: MVL
6 Replies

6. Programming

Getting IP Address of a client

I read an other post with a similar title but thios is different. here is a basic portion layout of our network Win PC 1 w/Refection X -- | Win PC 2 w/Refection X -- |-- 1 of 6 HP Unix servers -- Win 2k pc Win PC 3 w/Refection X -- ... (0 Replies)
Discussion started by: fayette
0 Replies

7. Programming

Retrieving IP address of Client from Server

Hi All, When I connect to a unix server from a client machine, how can I get the IP address of the client? One way of retrieving IP address of client which initiates an active connection to the server is through /var/adm/utmpx file upon login; client's IP address and other info would have... (4 Replies)
Discussion started by: matrixmadhan
4 Replies

8. UNIX for Dummies Questions & Answers

client IP address

when working on a telnet is it possible the client machine accessing the server machine supply its IP Address to the server machine . The only other shell i can use is the TCL shell. (2 Replies)
Discussion started by: rolly
2 Replies

9. IP Networking

Client Ip Address

I have a UNIX daemon program which takes client connections via TCP/IP sockets. What I need to know is if there is any way of getting the IP address of the client socket once a connection has been made... or do I have to code my client to send it manually ? Thanks. (1 Reply)
Discussion started by: ovingtond
1 Replies

10. UNIX for Dummies Questions & Answers

IP address of telnet client

Hi, I am using the telnet client on windowsNT to access the Unix system. I want to find out the IP address of the telnet client from the server side. The reason is I want to set the DISPLAY environment variable when the user is logged on. Is there anyway that the the Unix server can... (1 Reply)
Discussion started by: vtran4270
1 Replies
Login or Register to Ask a Question