![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| IP Networking Questions involving TCP/IP, Routers, Hubs, Network protocols, etc go here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Getting IP Address of a client | fayette | High Level Programming | 0 | 03-24-2006 10:27 AM |
| Retrieving IP address of Client from Server | matrixmadhan | High Level Programming | 4 | 03-21-2006 01:06 AM |
| client IP address | rolly | UNIX for Dummies Questions & Answers | 2 | 03-17-2005 05:14 PM |
| Client Ip Address | ovingtond | IP Networking | 1 | 09-15-2003 02:45 PM |
| IP address of telnet client | vtran4270 | UNIX for Dummies Questions & Answers | 1 | 09-12-2002 01:34 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
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? |
| Forum Sponsor | ||
|
|
|
|||
|
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. |
|
||||
|
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. |