Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!boingo.med.jhu.edu!haven.umd.edu!umbc3.umbc.edu!bernie From: bernie@umbc3.umbc.edu (Bernard J. Duffy) Newsgroups: comp.sys.sgi Subject: Re: setting REMOTEHOST on rlogins Summary: it is available to via utmp Message-ID: <1991Jun21.173050.9868@umbc3.umbc.edu> Date: 21 Jun 91 17:30:50 GMT References: <1991Jun12.174725@spruce.gsfc.nasa.gov> Organization: University of Maryland Baltimore County Lines: 35 In article <1991Jun12.174725@spruce.gsfc.nasa.gov> karl@spruce.gsfc.nasa.gov (karl anderson) writes: >I'm just getting acquainted with SGI machines after using Suns alot. >I see that when I rlogin to one of our Irises, an environment variable >named "REMOTEHOST" is set to the name of the machine I'm logging in >from. Is this something unique to IRIX? I'd love to be able to do >that on my Suns - can anyone tell me how? Please answer by email, >as I don't ordinarily take this group. TIA. You can make a simple C program that could set this for you and it would be pretty easy to port to most of your un*x-es . I've noticed that the who command on most machines states which host a terminal or X session started a particular login. I think most of the "login" (like rlogin and telnet) programs / daemons provide this information. The informat for the REMOTEHOST is held in the world readable /etc/utmp that the who utility reads for you. Your non-suid (non-prived) program can scan /etc/utmp and extract the REMOTEHOST. This would be of use to X users because you can make various terminal settings based on the originating host (like ^? for DEL when it's not a window on an IRIS server). > >-- >Karl A. Anderson | Internet: karl@forest.gsfc.nasa.gov >NASA/GSFC code 923 (STX) | voice: (301) 286-3815 >Greenbelt, MD 20771 | #include "std_disclaimer" Have fun, Bernie bernie@pinhead.acs.umbc.edu UMBC: the only University with "County" in its name... that's why they want to change it. MD has lots of schools and very few big cities. -- Bernie Duffy Systems Programmer II | Bitnet : BERNIE@UMBC2 Academic Computing Services - L005e | Internet : BERNIE@UMBC2.UMBC.EDU Univ. of Maryland Baltimore County | UUCP : ...!uunet!umbc3!bernie Baltimore, MD 21228 (U.S.A.) | W: (301) 455-3231 H: (301) 744-2954