home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!destroyer!fmsrl7!ef2007!slee01!mjo
- From: mjo@slee01.srl.ford.com (Mike O'Connor)
- Newsgroups: comp.unix.admin
- Subject: Re: Identifying user's remote IP address at login?
- Date: 12 Nov 1992 19:11:33 GMT
- Organization: Not an official spokesperson for Ford Motor Co.
- Lines: 34
- Message-ID: <1dua95INNh4s@ef2007.efhd.ford.com>
- References: <1992Oct29.004719.9096@news.ysu.edu> <BxM36A.5HA@wang.com>
- Reply-To: "Mike O'Connor" <mjo@fmsrl7.srl.ford.com>
- NNTP-Posting-Host: slee01.srl.ford.com
-
- In article <BxM36A.5HA@wang.com> fredj@wang.com (Fast Freddie) writes:
- :ae954@yfn.ysu.edu (Andy Johnston) writes:
- :
- :
- :>I am trying to set up a system in which a utility called
- :>from the .login file can identify the IP address (or system name)
- :>of a remote user at login and perform a
- :> setenv DISPLAY <user's system>:0
- :>to make X displays pop up in the right place.
- :
- :>The utmp file only has 16 characters reserved for the remote
- :>name and is often truncated, so it isn't always reliable.
- :What you can do is scan/grep the utmp file for the 16 characters. Cut that
- :out and grep the etc/hosts file, cutting out the first field which usually
- :is the internet address.
-
- Some utmp fields have more than 16 characters.
-
- /etc/hosts is a really poor way of handling this.
-
- You grep what you can of the hostname for your username from some
- program that reads /etc/utmp, like "who", then comparing it with the
- IP addresses found in /dev/kmem-reading programs like netstat.
-
- Then it works. :)
-
- ...Mike
-
-
- --
- Michael J. O'Connor | Internet: mjo@FMSRL7.SRL.FORD.COM
- Ford Motor Company, OPEO | UUCP: ...!{backbone}!fmsrl7!mjo
- 20000 Rotunda, Bldg. 1-3001 | Phone: +1 (313) 248-1260
- Dearborn, MI 48121 | Fax: +1 (313) 323-6277
-