Determining Local IP Address within .profile

Mario Paumann
Wed, 04 Sep 2002 13:41:45 -0000

Hi !

I haven't found an easy solution to determine the local IP to which the
remote SSH client is connected to the local SSHD. We use MC/Serviceguard which
can create many Interfaces where a remote client could connect and we like to
know within .profile which interface the client has connected to.

I've looked at the sourcecode and maybe the following could do something I
described :

session.c:871 RCSID("$OpenBSD: session.c,v 1.142 2002/06/26 13:49:26
deraadt Exp $");
do_setup_env

        child_set_env(&env, &envsize, "SSH_LOCAL_IP",
get_local_ipaddr(packet_get_connection_in());

what do you think of it ?

thanx, mario