Sponsored Content
Top Forums Programming Retrieving IP address of Client from Server Post 102473 by matrixmadhan on Saturday 18th of March 2006 07:32:59 AM
Old 03-18-2006
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 been dumped into the file,

I just made use of utmpx structure to read the file with identification of line I am currently working and the loginname I was able to retrieve the client's IP address.

And that is how who command works

i just found one such similiar thread.
similiar thread

But I am searching for a method, to directly determine the client's IP address without depending on a file.

Any pointers on that!!!
Thanx in Advance.
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. IP Networking

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... (6 Replies)
Discussion started by: ka2d2
6 Replies

6. 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

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

8. Programming

Client/Server Socket Application - Preventing Client from quitting on server crash

Problem - Linux Client/Server Socket Application: Preventing Client from quitting on server crash Hi, I am writing a Linux socket Server and Client using TCP protocol on Ubuntu 9.04 x64. I am having problem trying to implement a scenario where the client should keep running even when the... (2 Replies)
Discussion started by: varun.nagpaal
2 Replies

9. Shell Programming and Scripting

Retrieving file size in a remote server using SSH

Hi, I have public and private keys and that's works fine for me. now I am sending files one by one on remote server and I want to check is file successfully delivered or not by comparing size of file on local machine and remote server using ‘stat -c%s'. Below operations need to be done on... (2 Replies)
Discussion started by: ketanraut
2 Replies

10. 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
rlogind(8c)															       rlogind(8c)

Name
       rlogind - remote login server

Syntax
       /etc/rlogind

Description
       The server is used for the program.  The server provides a remote login facility with authentication based on privileged port numbers.

       The  server is invoked by when it receives a connection on the port indicated in the login service specification.  For further information,
       see When a service request is received, the following protocol is initiated:

       1.  The server checks the client's source port.	If the port is not in the range 0-1023, the server aborts the connection.

       2.  The server checks the client's source address and requests the corresponding host name.  If the hostname cannot be determined, the dot-
	   notation representation of the host address is used.

       Once  the source port and address have been checked, allocates a pseudo terminal and manipulates file descriptors so that the slave half of
       the pseudo terminal becomes the stdin, stdout, and stderr for a login process.  For further information, see

       The login process is an instance of the program, invoked with the option.  The login process then proceeds with the authentication  process
       as described in but if automatic authentication fails, it reprompts the user to log in on a standard terminal line.

       The  parent of the login process manipulates the master side of the pseudo terminal, operating as an intermediary between the login process
       and the client instance of the program.	In normal operation, the packet protocol described in is invoked to provide ^S/^Q type	facilities
       and propagate interrupt signals to the remote programs.	The login process propagates the client terminal's baud rate and terminal type, as
       found in the environment variable, TERM.  For further information see

       The screen or window size of the terminal is requested from the client, and any changes in the window size from the client are sent to  the
       pseudo terminal.

Restrictions
       The authentication procedure used here assumes the integrity of each client machine and the connecting medium.  This is insecure, but it is
       useful in an open environment.

Diagnostics
       All diagnostic messages are returned on the connection associated with the stderr, after which any  network  connections  are  closed.	An
       error is indicated by a leading byte with a value of 1.

       Hostname for your address unknown
       No entry in the host name database existed for the client's machine.

       Try again
       A fork by the server failed.

       /bin/sh: ...
       The user's login shell could not be started.

See Also
       rlogin(1c), inetd(8c)

																       rlogind(8c)
All times are GMT -4. The time now is 09:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy