home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / admin / 6156 < prev    next >
Encoding:
Internet Message Format  |  1992-11-12  |  1.7 KB

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