Check the value of the SSH_CONNECTION environment variable.

Mark Post

-----Original Message-----
From: Linux on 390 Port [mailto:[EMAIL PROTECTED] On Behalf Of
Ulisses Penna
Sent: Tuesday, April 26, 2005 7:33 AM
To: [email protected]
Subject: xinetd - how to figure out from which interface a connection is
coming


Hi all,

        I have a zLinux image that is used for lots of users (ssh) for an
internal app. The Linux box is configured with various TCP/IP interfaces
like:

ip_1 -> eth0:0  (user_1)
ip_2 -> eth0:1  (user_2)
ip_3 -> eth0:2  (user_3)

and so on.

        Each user has its own TCP/IP address. Then I have a xinetd service
called "printBB" that is started when a connection is coming to port 5000.

        The server app that is running under the "printBB" xinetd service is
a *shell script*. My problem is to determine which interface was trigerred.
I know I can find the remote address but what I want is the local address. I
mean, the client application connected to which interface: ip_1 (eth0:0) or
(ip_2) (eth0:1) ... ? Finding that, I can map the IP address (or
interface) to the user.
        Is there something at the /proc/${PID} that can help me (or anywhere
else)? Or do I have to write a small C program to find out the local
address/interface?

Thanks in advance.
---------------------------------------------------------
Ulisses de Sousa Penna
Analista Consultor - Banco do Brasil
Fone: +55-61-310-6320   Fax: +55-61-310-6435
---------------------------------------------------------

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions, send email
to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

----------------------------------------------------------------------
For LINUX-390 subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: INFO LINUX-390 or visit
http://www.marist.edu/htbin/wlvindex?LINUX-390

Reply via email to