
02-15-2008, 05:23 PM
|
| |
Re: IP Address
Brian K. White a écrit :
>----- Original Message -----
>From: "Brandt Eppler" <beppler@comcast.net>
>Newsgroups: comp.unix.sco.misc
>To: <sco-misc@lists.celestial.com>
>Sent: Tuesday, September 13, 2005 7:08 PM
>Subject: IP Address
>
>
>
>
>>Is there a way to determine the IP address that a telnet session came
>>from?
>>SCO v5.07
>>
>>
>
>>From inside said session? (like from inside a script or app the user will
>run, or in their .profile, or in /etc/profile)
>or from outside the session? (like a cron job or a reporting util a sys
>admin or other priviledged user will want to run to see everyone elses IP's
>sometimes)
>
>who -u all connections (who -uH to include a header)
>who -um your current connection (who -umH to include a header)
>finger -wf all connections (finger -w to include a header)
>
>caveats & notes:
>Displays hostnames if possible via the normal rules (ie, if /etc/resolv.conf
>exists, it's used, which usually means it tries dns, then /etc/hosts)
>
>If the hostname is very long, it gets chopped off and so the result may not
>be useful. (it may be useful if you are simply trying to establish if the
>user is coming from a known local lan IP or anywhere else, and don't really
>need to be able to for example, initiate connections back to the user to
>send print jobs)
>
>If the user is connecting via facetwin instead of telnet, then facetwin has
>the very annoying feature of putting the users windows netbios computer name
>in the who output
>which is pretty much useless and horribly broken. However, facetwin also has
>another feature that can be used to offset the broken who output, it
>supplies several environment variables in the users session. One of these
>is: FACETWINIPADDR which is set to the ip the user came from. If you need to
>determine the users IP from outside their session (say from a cron job or
>from a sys admin monitoring type of script) then I don't know what you can
>do other than put stuff in /etc/profile to test for FACETWINIPADDR, and if
>it exists, to write a tmp file named after the users tty, and in the file
>put the IP, and then those files can be read from other processes outside of
>the users session.
>
>If the user is connecting via ssh (openssh) instead of telnet, then openssh
>provides an env variable SSH_CLIENT, which has the IP the user came from
>(not the hostname)
>
>If the user is connecting via the console, xterms in X on the console,
>serial terminals, & dialin modems, then there is no IP so you want to check
>the tty (also in both the who and finger outputs) at the same time and
>depending on that, maybe sometimes skip trying to determine an IP.
>
>Brian K. White -- brian@aljex.com -- http://www.aljex.com/bkw/
>+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
>filePro BBx Linux SCO FreeBSD #callahans Satriani Filk!
>
>
>
>
>
Hi,
or "who -x" if still exists on OSR 5.07 ? (only have up to OSR 5.06
boxes !).
F. STOCK
--
****************
Enlever ".remove-me" dans l'adresse.
Remove ".remove-me" from e-mail.
**************** |