rsh, remote user and host names...

Claude Cantin cantin at nrccsb2.di.nrc.ca
Fri Apr 19 04:38:05 AEST 1991


I'm writing an application which will use "rsh" to an account on our
local server.  That local server's account will not have any passwords, but
will have (for the shell) a program I'm writing in C.

For the utility/application to work properly, the server will need to know
the user name and host name of the remote machine.  If the remote system
is a Silicon Graphics machine, this is easy (I simply get the REMOTEUSER
and REMOTEHOST environment variables).  But NO such variables exist on
the Suns!!!

How can I get the remote host and remote user names????

The server is a Sun 3/60 running SunOS 4.0.3.  "remote" systems are
SGIs running IRIX 3.3.2, and Suns running both SunOS 4.0.3 and SunOS 4.1.1.

Any suggestions???

Thanks you,

-- 
    Claude Cantin			    tel: (613) 993 0240
    M-60, Chemin Montreal		    FAX: (613) 954 2561
    Conseil National de Recherches Canada   BITNET: cantin at nrcvm01
    Ottawa, Canada (K1A 0R6)		    INTERNET: cantin at nrccsb3.di.nrc.ca



More information about the Comp.lang.c mailing list